{"author_link":"\/users\/rohezal","author_name":"rohezal","author_uid":"rohezal","comments":[],"epoch":1586341493,"event":"LD46","format":"md","ldjam_node_id":182451,"likes":12,"metadata":{"p_key":"138051","p_author":"rohezal","p_authorkey":"1056438","p_urlkey":"354350","p_title":"Avoid duplicated themes code [Python]","p_cat":"LDJam ","p_event":"LD46","p_time":"1586341493","p_likes":"12","p_comments":"0","p_status":"WAYBACK","us_key":"1056438","us_name":"rohezal","us_username":"rohezal","event_start":"1587081600","event_key":"77","event_name":"Ludum Dare 46"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD46","removed_author":false},"_superparent":176557,"_trust":3,"author":56438,"body":"## Avoid duplicated themes\nThe duplicated themes are realy annoying. Here is working python code to remove them. It can be converted to php and put into the right file of the ludum dare source code (did not find it yesterday). Maybe add a second page after a theme was suggested, which tells the user which similar themes exists or if there is exactly the same theme already there.\n\nhttps:\/\/pastebin.com\/94a0NSau\n\n## Usage\nInput: \n\n>\"The world is not enough\"\n\nOutput: \n> Representative version of theme: world not enough\n\n> Representative themes which have an important word in common: ['loving whole world', 'enough enough', 'world not enough']\n\n> Theme is duplicated: True\n\n## Explanation\n\nsuggested_themes are themes which are already in the database:\n\n>suggested_themes = [\"Loving the whole world\", \"The dog is evil\", \"Enough is enough\", \"And the world is not enough ...\"]\n\nmytheme is a new theme the user want to suggest.\n>mytheme = \"The world is not enough\"\n\ncleanTheme creates a more representative string of the theme. It makes it lower case, removes are spaces, \"and\"s \"or\"s, etc.\n\n>clean_theme = cleanTheme(mytheme)\n\nfindSimilarThemes checks if a theme in representative form is kind of in the database already.\n> matching_themes = findSimilarThemes(clean_theme,suggested_themes_clean)\n\n\ncheckForDuplicateTheme checks if there is a representative theme which matches the new theme (representative) exactly\n>is_duplicate = checkForDuplicateTheme(clean_theme, suggested_themes_clean)","comments":3,"comments-timestamp":"2020-04-08T17:16:26Z","created":"2020-04-08T10:17:02Z","files":[],"files-timestamp":0,"id":182451,"love":12,"love-timestamp":"2020-04-10T09:55:49Z","meta":[],"modified":"2020-04-10T09:55:49Z","name":"Avoid duplicated themes code [Python]","node-timestamp":"2020-04-08T10:49:54Z","parent":182450,"parents":[1,5,9,176557,182450],"path":"\/events\/ludum-dare\/46\/the-siege-of-yggdrasil\/avoid-duplicate-themes-code-python","published":"2020-04-08T10:24:53Z","scope":"public","slug":"avoid-duplicate-themes-code-python","subsubtype":"","subtype":"","type":"post","version":541620},"node_metadata":{"n_key":"182451","n_urlkey":"354350","n_parent":"182450","n_path":"\/events\/ludum-dare\/46\/the-siege-of-yggdrasil\/avoid-duplicate-themes-code-python","n_slug":"avoid-duplicate-themes-code-pyth","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"56438","n_created":"1586341022","n_modified":"1586512549","n_version":"541620","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/46\/the-siege-of-yggdrasil\/avoid-duplicate-themes-code-python","text":"## Avoid duplicated themes\nThe duplicated themes are realy annoying. Here is working python code to remove them. It can be converted to php and put into the right file of the ludum dare source code (did not find it yesterday). Maybe add a second page after a theme was suggested, which tells the user which similar themes exists or if there is exactly the same theme already there.\n\nhttps:\/\/pastebin.com\/94a0NSau\n\n## Usage\nInput: \n\n>\"The world is not enough\"\n\nOutput: \n> Representative version of theme: world not enough\n\n> Representative themes which have an important word in common: ['loving whole world', 'enough enough', 'world not enough']\n\n> Theme is duplicated: True\n\n## Explanation\n\nsuggested_themes are themes which are already in the database:\n\n>suggested_themes = [\"Loving the whole world\", \"The dog is evil\", \"Enough is enough\", \"And the world is not enough ...\"]\n\nmytheme is a new theme the user want to suggest.\n>mytheme = \"The world is not enough\"\n\ncleanTheme creates a more representative string of the theme. It makes it lower case, removes are spaces, \"and\"s \"or\"s, etc.\n\n>clean_theme = cleanTheme(mytheme)\n\nfindSimilarThemes checks if a theme in representative form is kind of in the database already.\n> matching_themes = findSimilarThemes(clean_theme,suggested_themes_clean)\n\n\ncheckForDuplicateTheme checks if there is a representative theme which matches the new theme (representative) exactly\n>is_duplicate = checkForDuplicateTheme(clean_theme, suggested_themes_clean)","title":"Avoid duplicated themes code [Python]","wayback_source":[]}