Skip to main content

Extract synonyms from sentences using Aho Corasick algorithm

Project description


synonym-extractor
==============

``Usage``::

# Create an object of SynonymExtractor
synonym_extractor = SynonymExtractor()

# add synonyms to it
synonym_names = ['NY', 'SF']
clean_names = ['new york', 'san francisco']

for synonym_name, clean_name in zip(synonym_names, clean_names):
synonym_extractor.add_to_synonym(synonym_name, clean_name)

synonyms_found = synonym_extractor.get_synonyms_from_sentence('I love SF and NY')

``Output``::

synonyms_found
>> ['new york', 'san francisco']

Algorithm
----------

synonym-extractor is based on `Aho-Corasick algorithm
<https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm>`_.

Documentation
----------

Documentation can be found at `Read the Docs
<http://synonym-extractor.readthedocs.org>`_.

License
-------

The project is licensed under the MIT license.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synonym-extractor-0.1.0.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

synonym_extractor-0.1.0-py2.py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page