Skip to content

Commit

Permalink
change ExactAnalyzer to SubformAnalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
xsandr committed Dec 23, 2015
1 parent d5799dc commit fa96ab8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ta4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def absorptions(phrases):


def is_contains(haystack, needle):
return bool(ExactAnalyzer().mark(needle, haystack, 0, should_mark=False))
return bool(SubformsAnalyzer().mark(needle, haystack, 0, should_mark=False))


def activate_marker(marker_sentence, marker, sentence):
Expand Down
15 changes: 15 additions & 0 deletions tests/test_absorptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@
(u"[подъёмник]", 0),
(u"[мачтовый]", 0)]
),
(
[(u'мачтовые подъемники', 1),
(u'[мачтовый]', 2),
(u'мачтовые', 1),
(u'подъемники', 1),
(u'[подъёмник]', 2),
(u'[мачтовый] [подъёмник]', 2)],
[(u'мачтовые подъемники', 1),
(u'[мачтовый]', 0),
(u'мачтовые', 0),
(u'подъемники', 0),
(u'[подъёмник]', 0),
(u'[мачтовый] [подъёмник]', 1)],
)
])
def test_absorptions(input, result):
assert set(absorptions(input)) == set(result)
Expand Down

0 comments on commit fa96ab8

Please sign in to comment.