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