Skip to content

Commit

Permalink
Merge pull request #2 from riggy2013/minor_bug_fix_001
Browse files Browse the repository at this point in the history
minor bugs.
  • Loading branch information
eroux authored Jun 12, 2019
2 parents 334ecf8 + df353cd commit a0b4164
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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

0 comments on commit a0b4164

Please sign in to comment.