{ "info": { "author": "Rafael Fidelis", "author_email": "rafaelfid3lis@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nDescription: # Esperanto Analyzer\n \n ----\n \n ![Esperanto Flag](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/Flag_of_Esperanto.svg/640px-Flag_of_Esperanto.svg.png?1535986891157)\n \n ## Build Status:\n \n ### Development:\n \n [![Build Status](https://travis-ci.com/fidelisrafael/esperanto-analyzer.svg?token=k5uMpn3U564QqWar8oA1&branch=development)](https://travis-ci.com/fidelisrafael/esperanto-analyzer)\n \n ### Master:\n \n [![Build Status](https://travis-ci.com/fidelisrafael/esperanto-analyzer.svg?token=k5uMpn3U564QqWar8oA1&branch=master)](https://travis-ci.com/fidelisrafael/esperanto-analyzer)\n \n ---\n \n ### Atendu! Kio estas Esperanto? (_Wait! What is Esperanto?_)\n \n That is a fair question! Esperanto is the most widely spoken constructed international auxiliary language\n (_conlang_) in the world. It was created back in **1887** by a polish-jewish guy named \"Ludwik Lejzer Zamenhof\"_(often refered as L.L Zamenhof)_. Zamenhof's goal was to **create an easy and flexible language** that would serve as a universal second language to foster peace and international understanding of people from all around the world.\n \n The phonology, grammar, vocabulary, and semantics are based on the **Indo-European**(_Italian_,_Spanish_,_French_, _Catalan_, _Russian_, _German_...) languages spoken in Europe. The sound inventory is essentially **Slavic**, as is much of the semantics, whereas the vocabulary derives primarily from the **Romance languages**, with a lesser contribution from **Germanic languages** and minor contributions from **Slavic languages** and **Greek**.\n \n The language has more than **130 years of history** and culture now, and a very active community as well.\n \n Esperanto is a SUPER regular language, this means that the language does not have **irregular verbs** or **gender distinction for articles**, beside this Esperanto has only **16 grammar rules**.\n For example, one of the rules: ALL **Nouns** MUST end with the vowel `o`, eg:\n \n - `domo`\n - `homo`\n - `komputilo`\n - `komputilisto`\n \n Or **Adjectives** MUST end with the letter `a`, eg:\n \n - `bela`\n - `granda`\n - `varma`\n - `malvarma`\n \n If you want to know (or learn) more about Esperanto, you should read the following links:\n \n - [Esperanto at Wikipedia](https://www.wikiwand.com/en/Esperanto)\n - [Kio estas Esperanto? (in Esperanto)](https://lernu.net/eo/esperanto) or in [English](https://lernu.net/es/esperanto)\n - Esperanto course at Duolingo for: [[English speakers]](https://www.duolingo.com/course/eo/en/Learn-Esperanto-Online), [[Portuguese speakers]](https://www.duolingo.com/course/eo/pt/Learn-Esperanto-Online), [[Spanish speakers]](https://www.duolingo.com/course/eo/es/Learn-Esperanto-Online)\n - [Esperanto course at Lernu.net](http://lernu.net/kurso)\n - [Youtube serie: Esperanto estas...](https://www.youtube.com/watch?v=RlftmTm8I18&list=PL83728C14BFC5822F)\n \n ---\n \n ## About this project\n \n The aim of this project is to create one tool that can read and grammarly classify Esperanto sentences.\n \n The first part of project consists in **Morphological Analyzes** of Esperanto words, the next step is to create a **Syntactical Analyzer** for the language as well.\n \n ---\n \n ## How to use it?\n \n Simple! You can use it from the CLI(_Command Line Interface_) or importing as a library within your Python code.\n \n Let's start using the CLI to morphologically classify one basic Esperanto sentence:\n \n ## Installation\n \n First, install it:\n \n ```bash\n $ pip install esperanto-analyzer\n ```\n \n Now you will have the libraries source-code files in your system, and also the executable `binary` through CLI, test it:\n \n ```bash\n $ eo-analyzer --version\n > Version: 0.0.1\n ```\n \n ## CLI usage:\n \n ```sh\n $ eo-analyzer \"Jen la alfabeto de Esperanto. \u0108iu litero \u0109iam sonas same kaj literumado estas perfekte regula. Klaku la ekzemplojn por a\u016ddi la elparolon!\"\n ```\n \n ![eo-analyzer response](https://i.imgur.com/4hWUcWY.png)\n \n Pretty cool humn?\n \n ## Python library usage\n \n Ok, so now you want to import this library in your project, right? That's super simple, just drop these lines in your project:\n \n ### Morphological analyzes of sentences\n \n ```py\n from esperanto_analyzer import MorphologicalSentenceAnalyzer\n \n # Creates one instance to morphologically analyzes one sentence\n analyzer = MorphologicalSentenceAnalyzer(\"Esperanto estas tre facila lingvo al lerni.\")\n analyzer.analyze() # => Returns True/False\n \n # This is the simplest human-readable response of the morphological analyzes' results\n print(analyzer.simple_results())\n # => [['Esperanto', 'Noun'], ['estas', 'Verb'], ['tre', 'Adverb'], ['facila', 'Adjective'], ['lingvo', 'Noun'], ['al', 'Preposition'], ['lerni', 'Verb']]\n \n ```\n \n But you can always deal with a more complex results set if you (or better, your software) want/need to:\n \n ```py\n # The `#results()` method returns a Array object wirh a more complex structure than `#simple_results()` method\n results = analyzer.analyzes_results()\n first_analyze = results[0]\n \n # Returns and Array object with `AnalyzeResult` objects\n print(results)\n # => [, ,(...)]\n \n print(first_analyze)\n # => \n \n # Rich and detailed results using `AnalyzeResult`\n print(first_analyze.result)\n # => \n \n # Get any information that you might need using the response objects API\n print((first_analyze.result.raw_word, first_analyze.result.matches, first_analyze.result.word_class() ))\n # => ('Esperanto', , )\n \n ```\n ---\n \n ### Morphological analyze of a single WORD\n \n You can also use the internal analyzers of **words** if you want so, ex:\n \n ```py\n from esperanto_analyzer.analyzers.morphological import AdjectiveMorphologicalAnalyzer, NumeralMorphologicalAnalyzer\n \n # There's the total of `10` morphological analyzers, such as `VerbMorphologicalAnalyzer`, `NumeralMorphologicalAnalyzer`\n analyzer = AdjectiveMorphologicalAnalyzer('belajn')\n # If it returns true, that means that the inputed word is a valid adjective. False otherwise\n analyzer.analyze() # => returns True/False\n \n print(analyzer.matches)\n # => \n print(analyzer.raw_word) # => 'belajn'\n \n # The `word` property is one class object that inherits from the `Word` class.\n print(analyzer.word)\n # => \n \n # Get the base class name for the detected 'Part of Speech' class\n print(analyzer.word.__class__.__name__) # => 'Adjective'\n \n numeral_analyzer = NumeralMorphologicalAnalyzer('na\u016dcent')\n numeral_analyzer.analyze() # => True\n \n print(numeral_analyzer.word)\n # => \n \n print(numeral_analyzer.matches)\n # => \n \n ```\n \n ---\n \n ### Parts of Speech: Word, Article, Adverb, Adjective, Verb...\n \n You can even use the **Parts of Speech**(such as `Article`, `Adverb`, `Pronoun`, `Conjunction`) of the language:\n \n ```py\n # `esperanto_analyzer.speech` is home for all parts-of-speech classes\n from esperanto_analyzer.speech import Article\n \n # Raises an `InvalidArticleError` Exception, since 'lo' is not an Esperanto article\n article = Article('lo')\n \n # 'La' is the ONLY valid article in Esperanto\n valid_article = Article('la')\n \n \n # All `esperanto_analyzer.speech` objects inherits from `esperanto_analyzer.speech.word.Word` class\n print(valid_article.__class__.__bases__) # => (esperanto_analyzer.speech.word.Word,)\n \n # La is invariable article, it's the same for plural and singular sentences, ex:\n # 'La domo' # The house\n # 'La domoj' # The houses\n print(valid_article.plural) # => False\n \n # You can provide some `context` when creating the `Part of Speech` so it can determine if the word should be in plural or singular, eg:\n print(Article('la', 'domoj').plural) # => True\n \n \n ```\n \n ---\n \n ## Development Setup\n \n Clone this repository:\n \n ```bash\n $ git clone https://github.com/fidelisrafael/esperanto-analyzer.git\n $ cd esperanto-analyzer\n ```\n \n Make sure you have `python` >= `3.7.0` and `virtualenv` >= `16.0.0` installed:\n \n ```bash\n $ python --version\n > Python 3.7.0\n $ virtualenv --help\n > 16.0.0\n ```\n \n Otherwise, [install it](https://virtualenv.pypa.io/en/stable/installation/).\n \n Then, create one new `virtualenv` and activate it:\n \n ```bash\n $ virtualenv venv\n $ source venv/bin/activate\n ```\n \n Install the dependencies for development and test enviroments:\n \n ```bash\n # If you just want to install the needed dependencies for production, just run: `make init`\n $ make init_dev\n > pip install -r development_requirements.txt\n > pip install -r test_requirements.txt\n > pip install -r requirements.txt\n ```\n \n Run the tests:\n \n ```bash\n $ make test\n > pytest tests --cov-config .coveragerc --cov=esperanto_analyzer --cov-report=html\n > =============================================================================== test session starts ================================================================================\n > platform darwin -- Python 3.7.0, pytest-3.7.4, py-1.6.0, pluggy-0.7.1\n > rootdir: /(...)/esperanto_analyzer, inifile:\n > plugins: cov-2.5.1\n > collected 492 items\n \n > (...)\n \n > ====================================================================== 492 passed, 2 warnings in 2.61 seconds ======================================================================\n ```\n \n You can follow the code coverage stats opening: `coverage/index.html`\n \n ### OBS: This library has **100%** code coverage at the time of this writing!\n \n ---\n \n #### Built-in JSON Web API\n \n **_Note: This web API will be published as a separated package in a near future._**\n \n This library cames with a very simple HTTP Server built on top of Flask to provide an WEB API interface for integration with others systems. You can run the HTTP server running the following make task in the root folder of the project:\n \n ```bash\n $ make web_api # or simply running: python web/runserver.py\n > python esperanto_analyzer/web/runserver.py\n > * Serving Flask app \"esperanto_analyzer.web.api.server\" (lazy loading)\n > * Environment: production\n > WARNING: Do not use the development server in a production environment.\n > Use a production WSGI server instead.\n > * Debug mode: on\n > * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)\n ```\n \n Or you can just run it from inside any python project with:\n \n ```py\n from esperanto_analyzer.web import run_app\n \n run_app(debug=True, port=9090)\n # * Serving Flask app \"esperanto_analyzer.web.api.server\" (lazy loading)\n # * Environment: production\n # WARNING: Do not use the development server in a production environment.\n # Use a production WSGI server instead.\n # * Debug mode: off\n # * Running on http://127.0.0.1:9090/ (Press CTRL+C to quit)\n \n ```\n \n This server has auto-reload(or hot-reload) enabled by default, so you don't need to restart the server when you change the source code.\n \n To test it:\n \n ```bash\n curl http://127.0.0.1:5000/analyze?sentence=Kio%20estas%20Esperanto%3F%20%C4%9Ci%20estas%20lingvo%20tre%20ta%C5%ADga%20por%20internacia%20komunikado.\n ```\n \n \n ---\n \n ## How it works?\n \n This library can be used in a miriad of ways to analyze Esperanto sentences and words, for a complete reference of the API and all the possibilities you should check the 'Full API' section.\n \n [TODO]\n \n ---\n \n \n ## :calendar: Roadmap \n \n - :white_medium_small_square: Create syntactical analyzers\n - :white_medium_small_square: Update this Roadmap with more plans\n \n ---\n \n ## :thumbsup: Contributing\n \n Bug reports and pull requests are welcome on GitHub at http://github.com/fidelisrafael/esperanto_analyzer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n \n ---\n \n ## :memo: License\n \n The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n \nPlatform: UNKNOWN\nClassifier: Programming Language :: Python :: 3.7\nClassifier: Programming Language :: Python :: 3\nClassifier: Intended Audience :: Developers\nClassifier: Intended Audience :: Education\nClassifier: Intended Audience :: Information Technology\nClassifier: Intended Audience :: Science/Research\nClassifier: Topic :: Scientific/Engineering\nClassifier: Topic :: Scientific/Engineering :: Artificial Intelligence\nClassifier: Topic :: Scientific/Engineering :: Human Machine Interfaces\nClassifier: Topic :: Scientific/Engineering :: Information Analysis\nClassifier: Topic :: Text Processing\nClassifier: Topic :: Text Processing :: Filters\nClassifier: Topic :: Text Processing :: General\nClassifier: Topic :: Text Processing :: Indexing\nClassifier: Topic :: Text Processing :: Linguistic\nClassifier: License :: OSI Approved :: MIT License\nClassifier: Operating System :: OS Independent\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fidelisrafael/esperanto-analyzer", "keywords": "", "license": "Copyright (c) 2018, Rafael Fidelis", "maintainer": "", "maintainer_email": "", "name": "esperanto-analyzer", "package_url": "https://pypi.org/project/esperanto-analyzer/", "platform": "", "project_url": "https://pypi.org/project/esperanto-analyzer/", "project_urls": { "Homepage": "https://github.com/fidelisrafael/esperanto-analyzer" }, "release_url": "https://pypi.org/project/esperanto-analyzer/0.0.3/", "requires_dist": [ "tableprint (==0.8.0)", "Flask (==1.0.2)", "Flask-RESTful (==0.3.6)", "flask-restful-swagger (==0.20.1)" ], "requires_python": "", "summary": "Morphological and syntactic analysis of Esperanto sentences.", "version": "0.0.3" }, "last_serial": 4237968, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ac7aac283aec103ee9c2ac21216e9667", "sha256": "4c73a9ee174dc18863fe0fd93f3da80d41b06392102bd52d3ee5f6854fd7c9c5" }, "downloads": -1, "filename": "esperanto_analyzer-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "ac7aac283aec103ee9c2ac21216e9667", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 27194, "upload_time": "2018-09-04T14:20:54", "url": "https://files.pythonhosted.org/packages/b5/5a/5c4106896456da64f443ddc8fab4db41300c8cdfa1d43213ce66102e98ec/esperanto_analyzer-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26639aef021460254992f68db282ff56", "sha256": "f834602368561ee345ed64b79d4ee79612edf1d2fb540f4cd07ef88d58dfd7be" }, "downloads": -1, "filename": "esperanto-analyzer-0.0.1.tar.gz", "has_sig": false, "md5_digest": "26639aef021460254992f68db282ff56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21626, "upload_time": "2018-09-04T14:20:56", "url": "https://files.pythonhosted.org/packages/fd/b0/2af80495dfeb78f9f6a77b24a65e150dac47049c89c63e8f011f9c6f7671/esperanto-analyzer-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "00a66c42262a4b94710f3ea4fedc4f2b", "sha256": "b3c56d9054856b65d9ed34a018c9d398797cb946687fe9120d078d26e57865a1" }, "downloads": -1, "filename": "esperanto_analyzer-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "00a66c42262a4b94710f3ea4fedc4f2b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31439, "upload_time": "2018-09-04T14:40:02", "url": "https://files.pythonhosted.org/packages/70/99/6218671b13c66f1b10db8e0132e22c7f289c1e9d574a22223b3270b936ac/esperanto_analyzer-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5cbb52f22276e22538829d5201c33481", "sha256": "3dedd0a0ece409cafb0cfda8b92f486f48f560cb4032d1dfef4b17251231c9cc" }, "downloads": -1, "filename": "esperanto-analyzer-0.0.2.tar.gz", "has_sig": false, "md5_digest": "5cbb52f22276e22538829d5201c33481", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23768, "upload_time": "2018-09-04T14:40:04", "url": "https://files.pythonhosted.org/packages/93/19/deff68540ffd68170f4eda2aeacfcbd6597f7b3c7d01c22654023d228be5/esperanto-analyzer-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "09cc30dcac30a1aa311a34cfb612ed1b", "sha256": "516120e5d40fbd84790622f7dae6d242384b8ef70118361ef5b578cae39d8cdc" }, "downloads": -1, "filename": "esperanto_analyzer-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "09cc30dcac30a1aa311a34cfb612ed1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31449, "upload_time": "2018-09-04T14:53:28", "url": "https://files.pythonhosted.org/packages/05/68/a77589ff09e1a17a03768fd474bde80e1637933ee9dd73496563f260dac8/esperanto_analyzer-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6674a1a729d69c33bcb9ec4c5a75e71", "sha256": "d496c5f997f90cebcf691c1f7eff6128940957c609120f017a699e884b101f2a" }, "downloads": -1, "filename": "esperanto-analyzer-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6674a1a729d69c33bcb9ec4c5a75e71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23781, "upload_time": "2018-09-04T14:53:31", "url": "https://files.pythonhosted.org/packages/3e/1f/692c881a43515d57b009d5f0291b857302947c7c8bd2246a41d081fc39bf/esperanto-analyzer-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "09cc30dcac30a1aa311a34cfb612ed1b", "sha256": "516120e5d40fbd84790622f7dae6d242384b8ef70118361ef5b578cae39d8cdc" }, "downloads": -1, "filename": "esperanto_analyzer-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "09cc30dcac30a1aa311a34cfb612ed1b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 31449, "upload_time": "2018-09-04T14:53:28", "url": "https://files.pythonhosted.org/packages/05/68/a77589ff09e1a17a03768fd474bde80e1637933ee9dd73496563f260dac8/esperanto_analyzer-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6674a1a729d69c33bcb9ec4c5a75e71", "sha256": "d496c5f997f90cebcf691c1f7eff6128940957c609120f017a699e884b101f2a" }, "downloads": -1, "filename": "esperanto-analyzer-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d6674a1a729d69c33bcb9ec4c5a75e71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23781, "upload_time": "2018-09-04T14:53:31", "url": "https://files.pythonhosted.org/packages/3e/1f/692c881a43515d57b009d5f0291b857302947c7c8bd2246a41d081fc39bf/esperanto-analyzer-0.0.3.tar.gz" } ] }