Commits

Mikhail Korobov  committed 3e6b0ba

add more convenience to aot <-> positional conversion

  • Participants
  • Parent commits 63acad8

Comments (0)

Files changed (2)

File russian_tagsets/aot.py

     Converts positional.Tag to AOT format.
     This is lossy because of format differences.
     """
+    if not isinstance(positional_tag, positional.Tag):
+        positional_tag = positional.Tag(positional_tag)
+
     tag = positional_tag
     pos, info = '', set()
 

File russian_tagsets/positional/__init__.py

 
 class Tag(object):
     def __init__(self, txt='-'*16):
+        if isinstance(txt, bytes):
+            txt = txt.decode('ascii')
         self._data = array.array(str('u'), txt)
 
     mainPOS = property(*_prop(0))