Commits

Mikhail Korobov committed 58cb74b

backwards-incompatible: opencorpora -> opencorpora-ext

Comments (0)

Files changed (3)

 
     >>> converters.get_supported()
     [(u'positional', u'aot'),
-     (u'opencorpora', u'opencorpora-int'),
-     (u'opencorpora', u'aot'),
+     (u'opencorpora-ext', u'opencorpora-int'),
+     (u'opencorpora-ext', u'aot'),
      (u'aot', u'positional'),
      (u'aot', u'dialog2010'),
      (u'dialog2010', u'aot'),
      (u'opencorpora-int', u'ruscorpora'),
-     (u'opencorpora-int', u'opencorpora')]
+     (u'opencorpora-int', u'opencorpora-ext')]
 
 "Ручной" режим (быстрее, преобразование только напрямую)::
 

russian_tagsets/opencorpora.py

     return ','.join([pos] + info)
 
 
-def from_aot(aot_tag):
-    pass
-
-
-#def to_positional(open_tag):
-#    pass
-#
-#def from_positional(open_tag):
-#    pass
-
-converters.add('opencorpora-int', 'opencorpora', internal_to_external)
-converters.add('opencorpora', 'opencorpora-int', external_to_internal)
-converters.add('opencorpora', 'aot', to_aot)
-#converters.add('aot', 'opencorpora', from_aot)
+converters.add('opencorpora-int', 'opencorpora-ext', internal_to_external)
+converters.add('opencorpora-ext', 'opencorpora-int', external_to_internal)
+converters.add('opencorpora-ext', 'aot', to_aot)

russian_tagsets/tests/test_opencorpora.py

 
     @pytest.mark.parametrize(("word", "internal", "external"), TEST_DATA)
     def test_from_internal(self, word, internal, external):
-        converted = converters.convert(internal, 'opencorpora-int', 'opencorpora')
+        converted = converters.convert(internal, 'opencorpora-int', 'opencorpora-ext')
         assert converted == external
 
     @pytest.mark.parametrize(("word", "internal", "external"), TEST_DATA)
     def test_to_internal(self, word, internal, external):
-        converted = converters.convert(external, 'opencorpora', 'opencorpora-int')
+        converted = converters.convert(external, 'opencorpora-ext', 'opencorpora-int')
         assert converted == internal
 
 
 
     @pytest.mark.parametrize(("word", "open_tag", "aot_tag"), PARSE_RESULTS)
     def test_to_aot(self, word, open_tag, aot_tag):
-        converted = converters.convert(open_tag, 'opencorpora', 'aot')
+        converted = converters.convert(open_tag, 'opencorpora-ext', 'aot')
         assert aot.split_tag(_remove_unsupported(converted)) == aot.split_tag(_remove_unsupported(aot_tag))