Rename util.py -> expressions.py
This commit is contained in:
parent
886faf1984
commit
934f6534f1
|
@ -2,7 +2,7 @@ import re
|
||||||
from datetime import datetime, date
|
from datetime import datetime, date
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
import bot.util as Util
|
import bot.expressions as Expressions
|
||||||
|
|
||||||
|
|
||||||
class JitenonEntry:
|
class JitenonEntry:
|
||||||
|
@ -77,7 +77,7 @@ class JitenonEntry:
|
||||||
return [m.group(1)]
|
return [m.group(1)]
|
||||||
m = re.search(r"^[ぁ-ヿ、]+([ぁ-ヿ、])[ぁ-ヿ、]+$", yomikata)
|
m = re.search(r"^[ぁ-ヿ、]+([ぁ-ヿ、])[ぁ-ヿ、]+$", yomikata)
|
||||||
if m:
|
if m:
|
||||||
return Util.expand_shouryaku(yomikata)
|
return Expressions.expand_shouryaku(yomikata)
|
||||||
m = re.search(r"^([ぁ-ヿ、]+)(([ぁ-ヿ/\s、]+))$", yomikata)
|
m = re.search(r"^([ぁ-ヿ、]+)(([ぁ-ヿ/\s、]+))$", yomikata)
|
||||||
if m:
|
if m:
|
||||||
yomikatas = [m.group(1)]
|
yomikatas = [m.group(1)]
|
||||||
|
|
|
@ -4,10 +4,7 @@ import re
|
||||||
def expand_shouryaku(shouryaku):
|
def expand_shouryaku(shouryaku):
|
||||||
"""Return a list of words described by a 省略 notation.
|
"""Return a list of words described by a 省略 notation.
|
||||||
eg. "有(り)合(わ)せ" -> [
|
eg. "有(り)合(わ)せ" -> [
|
||||||
"有り合わせ",
|
"有り合わせ", "有合わせ", "有り合せ", "有合せ"
|
||||||
"有合わせ",
|
|
||||||
"有り合せ",
|
|
||||||
"有合せ"
|
|
||||||
]
|
]
|
||||||
"""
|
"""
|
||||||
groups = re.findall(r"([^(]*)((([^(]+)))?", shouryaku)
|
groups = re.findall(r"([^(]*)((([^(]+)))?", shouryaku)
|
|
@ -1,3 +1,4 @@
|
||||||
|
import re
|
||||||
from css_parser import parseStyle
|
from css_parser import parseStyle
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue