{"id":17128305,"url":"https://github.com/elinorbgr/ai-project","last_synced_at":"2025-10-10T09:07:51.579Z","repository":{"id":21920787,"uuid":"25245025","full_name":"elinorbgr/ai-project","owner":"elinorbgr","description":null,"archived":false,"fork":false,"pushed_at":"2014-11-02T16:47:55.000Z","size":516,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-04T15:49:50.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elinorbgr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-15T08:09:26.000Z","updated_at":"2014-10-17T09:19:28.000Z","dependencies_parsed_at":"2022-07-21T21:02:18.647Z","dependency_job_id":null,"html_url":"https://github.com/elinorbgr/ai-project","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elinorbgr/ai-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elinorbgr%2Fai-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elinorbgr%2Fai-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elinorbgr%2Fai-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elinorbgr%2Fai-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elinorbgr","download_url":"https://codeload.github.com/elinorbgr/ai-project/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elinorbgr%2Fai-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003389,"owners_count":26083579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T19:06:43.595Z","updated_at":"2025-10-10T09:07:51.560Z","avatar_url":"https://github.com/elinorbgr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Proverb Generator\n=================\n\nDepends on\n----------\n\n- the python library nltk : http://www.nltk.org/\n- the C++ library lttoolbox : http://wiki.apertium.org/wiki/Lttoolbox\n\nBuilding\n--------\n\nExecute the ``build.sh`` script to build the ``libltpy.so`` library, which will be used to interface our python program with lttoolbox.\n\nIt may require some adjustments to the location of your lttoolbox installation.\n\nUsing\n-----\n\nAll functions are defined in the ``main.py`` file. To use them, start a python shell in this folder and import them with ``from main import *``.\n\n### Building the background graph\n\nWe cannot provide the background graph as it is quite heavy (the fie is around 100MB). To build it, we provide two functions :\n\n```\nadd_file_to_background_graph(graph_file, input_file)\n```\n\nThis function inputs the whole ``input_file`` into the graph stored in ``graph_file``. If the graph file doesn't exist, it is created.\n\n```\nadd_words_to_background_graph(graph_file, words)\n```\n\nThis function add a list of words to the background graph in ``graph_file``. The word list is expected to be in the same format as the output of ``nltk.word_tokenize()``. If the graph file doesn't exist, it is created.\n\nIn order to build the same graph as the one we used, run :\n\n```\nadd_file_to_background_graph(\"proverbs.bgraph\", \"proverbsList.txt\")\nimport nltk\nadd_words_to_background_graph(\"proverbs.bgraph\", nltk.corpus.brown.words())\nadd_words_to_background_graph(\"proverbs.bgraph\", nltk.corpus.gutenberg.words())\n```\n\n### Using the generator\n\nOnce the background graph is created, you can make a generator object using it :\n\n```\ng = ProverbGenerator(\"proverbs.bgraph\")\n```\n\nThis will take some time to create it : the graph is normalized during the loading.\n\nThen, you can generate proverbs by giving the generator an input word :\n\n```\ng.generate(\"darkness\")\n```\n\nIt will output the proverb used as a gramatical basis, as well as the generated proverb.\n\nNote : if the input word is not in the graph, or is linked to too few words, the generated proverb will likely be the same as the one used as a basis.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felinorbgr%2Fai-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felinorbgr%2Fai-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felinorbgr%2Fai-project/lists"}