Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor bugs. #2

Merged
merged 1 commit into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#print(converter.toUnicode("ba b+ba [a] ba\\u0f0b"))

orig = "ba b+ba [a] ba\\u0f0b"
orig = "snga 'phros a ri gzhung dang rgya gar gzhung so sor gsang ba'i thog nas nang don mthun lam chen po zhig nges par tu thugs zab thog/"

print(orig)
warns = []
res = converter.toUnicode(orig, warns)
Expand All @@ -18,3 +20,8 @@

print(converter.toWylie("In Chinese"))

#warns = []
#print(converter.toUnicode("snga 'phros a ri gzhung dang rgya gar gzhung so sor gsang ba'i thog nas nang don mthun lam chen po zhig nges par tu thugs zab thog", warns))


#print(converter.toUnicode("snga ", warns))
6 changes: 3 additions & 3 deletions pyewts/pyewts.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ def toUnicodeOneStack(self, tokens, i):
t2 = tokens[i+1]
if t2 != None and self.isSuperscript(t) and self.superscript(t, t2):
if self.check_strict:
next = consonantString(tokens, i + 1)
next = self.consonantString(tokens, i + 1)
if not self.superscript(t, next):
next = next.replace("+", "")
warns.append("Superscript \"" + t + "\" does not occur above combination \"" + next + "\".")
Expand Down Expand Up @@ -1111,11 +1111,11 @@ def toUnicodeOneTsekbar(self, tokens, i):
if not self.check:
continue
if state == self.State.PREFIX and stack.single_consonant != None:
consonants.add(stack.single_consonant)
consonants.append(stack.single_consonant)
if self.isPrefix(stack.single_consonant):
next = t
if self.check_strict:
next = consonantString(tokens, i)
next = self.consonantString(tokens, i)
if next != None and not self.prefix(stack.single_consonant, next):
next = next.replace("+", "")
warns.append("Prefix \"" + stack.single_consonant + "\" does not occur before \"" + next + "\".")
Expand Down