Skip to content

Commit ce406fe

Browse files
committed
Fixed handling of spurious sign "N" in non-merged, non-split setting
1 parent db7dbcb commit ce406fe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/flask_app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def simplify_line( line, split=False, merge=False ):
6969
))
7070
if split:
7171
line = sum( line, [] )
72+
# Get rid of errors introduced by N(...) notation:
73+
line = [sign for sign in line if (sign != "N") and (not sign.startswith("N(")) and (not re.match("^N[0-9]",sign))]
7274
return line
7375

7476
def get_transliterations( text ):
@@ -122,7 +124,7 @@ def get_transliterations( text ):
122124
# Remove delimiters:
123125
line = [sign.strip() for sign in line if sign.strip() != "," and sign.strip() != ""]
124126
# Get rid of errors introduced by N(...) notation:
125-
line = [sign for sign in line if sign != "N" and not sign.startswith("N(") and not re.match("^N[0-9]",sign)]
127+
line = [sign for sign in line if (sign != "N") and (not sign.startswith("N(")) and (not re.match("^N[0-9]",sign))]
126128

127129
lines.append( line )
128130
lines = {

0 commit comments

Comments
 (0)