Skip to content

17zuoye/phrase_recognizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phrase Recognizer

Build Status Coverage Status Health Download License

Example

>>> from phrase_recognizer import PhrasalRecognizer
>>> recognizer = PhrasalRecognizer([ u"a lot of", u"tie...to...", u"or...or...a...a"])
>>> recognizer
[first_strs_dict] {u'a': True, u'tie': True, u'or': True}


[tree] {u'a': {u'lot': {u'of': {u'a lot of': True}}}, u'tie': {u'...': {u'to': {u'...': {u'tie...to...': True}}}}, u'or': {u'...': {u'or': {u'...': {u'a': {u'...': {u'a': {u'or...or...a...a': True}}}}}}}}
>>> recognizer.process(u"There are a lot of signs the grass.", replace=True)
[u'There are signs the grass.', [u'a lot of']]
>>> recognizer.process(u"To fasten or secure with or as if with a cord, rope, or strap: tied the kite to a post; tie up a bundle.")
[u'To fasten or secure with or as if with a cord, rope, or strap: tied the kite to a post; tie up a bundle.', [u'or...or...a...a', u'tie...to...']]

License

MIT. David Chen @ 17zuoye.

About

Phrase Recognizer。英文短语识别。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages