You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
could be used to clean strings with unpaired quotes before calling Juman.analyze(), but I don't find it satisfactory. It may just be an example of "garbage in, garbage out".
The problem is in morpheme.py: Morpheme._parse_spec() where quotes are handled in these nested if-statements (starting line 125):
# If "\"" proceeds " ", it would be not inside_quotes, but "\"".ifinside_quotesandchar==" "andpart=='"':
inside_quotes=Falseifpart!=""andchar==" "andnotinside_quotes:
ifpart.startswith('"') andpart.endswith('"') andlen(part) >1:
print(f"APPENDING PART0 {part}")
parts.append(part[1:-1])
else:
print(f"APPENDING PART1 {part}")
parts.append(part)
part=""else:
print(f"ADDING CHAR TO PART {part} + {char}")
part+=char
The expected behaviour (according only to me), should be '"test' and '"test' :: '\\ ' :: '"'.
The text was updated successfully, but these errors were encountered:
Something like
could be used to clean strings with unpaired quotes before calling
Juman.analyze()
, but I don't find it satisfactory. It may just be an example of "garbage in, garbage out".The problem is in
morpheme.py: Morpheme._parse_spec()
where quotes are handled in these nested if-statements (starting line 125):The expected behaviour (according only to me), should be
'"test'
and'"test' :: '\\ ' :: '"'
.The text was updated successfully, but these errors were encountered: