{"id":17703797,"url":"https://github.com/zudov/ohaskell-translation-tool","last_synced_at":"2025-03-31T04:18:40.444Z","repository":{"id":68795777,"uuid":"24621200","full_name":"zudov/ohaskell-translation-tool","owner":"zudov","description":"A small script to prepare markdown files for automatic proof-reading","archived":false,"fork":false,"pushed_at":"2014-09-30T04:28:16.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T08:45:39.194Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zudov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-30T02:25:00.000Z","updated_at":"2014-09-30T03:29:09.000Z","dependencies_parsed_at":"2023-02-21T09:30:15.925Z","dependency_job_id":null,"html_url":"https://github.com/zudov/ohaskell-translation-tool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fohaskell-translation-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fohaskell-translation-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fohaskell-translation-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fohaskell-translation-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zudov","download_url":"https://codeload.github.com/zudov/ohaskell-translation-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413242,"owners_count":20773054,"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","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-24T21:05:59.078Z","updated_at":"2025-03-31T04:18:40.431Z","avatar_url":"https://github.com/zudov.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"ohaskell-translation-tool\n=========================\n\n# Purpose\n\nI use [LanguageTool](https://languagetool.org/) for proof-reading and it often\nfinds real mistakes, but they are usually buried under the false-triggered\nspelling mistakes in the code blocks.\n\nThat script allows to get rid of most of the false-triggered mistakes by cleaning\nthe file before feeding it into LanguageTool (or some other proof-reading app)\n\n# What it does\n\nThe most important things that it does:\n\n- wipe code blocks (the taken space is preserved)\n- replace inline code with noun \"input\"/\"output\" depending on whether the first \n  letter is vowel (to get rid of a/an mistakes)\n- wipes the table in the beginning (the taken space is preserved)\n\nWhen removing, space is preserved, so when LanguageTool tells that the problem\nis on the line 20 it is on on the line 20 in the original file (or at least \nit's supposed to be there)\n\n\n# Usage\nI use it this way:\n\n```bash\nalias languagetool=\"java -jar /some/path/LanguageTool-2.6/languagetool-commandline.jar\"\nohaskell-translation-tool \u003c own-exceptions.md |  languagetool -l en-GB -d EN_QUOTES\n```\n\n# Ignore.txt\nI've also put a file ignore.txt, it contains words that are considered to be a\nspelling mistake (e.g. stdin, stdout, Hackage), you might want to append it to\nyour `org/languagetool/resource/en/hunspell/ignore.txt`, so that LanguageTool\ndoesn't whine about them.\n\n# Example\nSuppose we have such text:\n\n\t----\n\ttitle: Great function\n\tprevChapter: /better/function.html\n\tnextChapter: /worse/function.html\n\t----\n\n\t# Header\n\n\tThat is a awesome funtion `foldSum`:\n\n\t```haskell\n\tfoldSum :: [Int] -\u003e Int\n\tfoldSum = foldl (+) 0\n\t```\n\nRunning LanguageTool on it would return a whole bunch of mistakes.\n\n```bash\nzudov@rhea ~/prog/haskell/ohaskell-translation-tool $ languagetool -l en-GB -d EN_QUOTES \u003c example.md\nExpected text language: English (GB)\nWorking on STDIN...\n1.) Line 3, column 1, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\n---- title: Great function prevChapter: /better/function.html nextChapter: /worse/f...\n                           ^^^^^^^^^^^                                             \n2.) Line 4, column 1, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\n... function prevChapter: /better/function.html nextChapter: /worse/function.html ----  \n                                                ^^^^^^^^^^^                             \n3.) Line 8, column 9, Rule ID: EN_A_VS_AN\nMessage: Use 'an' instead of 'a' if the following word starts with a vowel sound, e.g. 'an article', 'an hour'\nSuggestion: an\n# Header That is a awesome funtion `foldSum`:  \n                 ^                             \n4.) Line 8, column 19, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\nSuggestion: function\n# Header That is a awesome funtion `foldSum`:  \n                           ^^^^^^^             \n5.) Line 8, column 28, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\n# Header That is a awesome funtion `foldSum`:  \n                                    ^^^^^^^    \n6.) Line 13, column 4, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\nSuggestion: Haskell\n```haskell foldSum :: [Int] -\u003e Int foldSum = foldl (+) ...\n   ^^^^^^^                                             \n7.) Line 14, column 1, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\n```haskell foldSum :: [Int] -\u003e Int foldSum = foldl (+) 0 ``` \n           ^^^^^^^                                           \n8.) Line 14, column 13, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\nSuggestion: ITT; Inc; Ind; NT; TNT; Ant; Dint; Hint; In; Ink; Inn; Ins; Inst; Into; It; Lint; Mint; Pint; Tint\n```haskell foldSum :: [Int] -\u003e Int foldSum = foldl (+) 0 ``` \n                       ^^^                                   \n9.) Line 14, column 21, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\nSuggestion: ITT; Inc; Ind; NT; TNT; Ant; Dint; Hint; In; Ink; Inn; Ins; Inst; Into; It; Lint; Mint; Pint; Tint\n```haskell foldSum :: [Int] -\u003e Int foldSum = foldl (+) 0 ``` \n                               ^^^                           \n10.) Line 15, column 1, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\n```haskell foldSum :: [Int] -\u003e Int foldSum = foldl (+) 0 ``` \n                                   ^^^^^^^                   \n11.) Line 15, column 11, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\nSuggestion: fold; folds; foll; fold l\n...```haskell foldSum :: [Int] -\u003e Int foldSum = foldl (+) 0 ``` \n                                                ^^^^^           \nTime: 524ms for 3 sentences (5.7 sentences/sec)\n```\n\nProcessing it with ohaskell-translation-tool would return such output:\n\n```bash\nzudov@rhea ~/prog/haskell/ohaskell-translation-tool $ ohaskell-translation-tool \u003c example.md \n\\\n\\\n\\\n\\\n\\\n\n# Header\n\nThat is a awesome funtion `input`:\n\n\\\n\\\n\\\n\\\n```\n\nAnd running LanguageTool on that would return something more useful:\n\n```bash\nzudov@rhea ~/prog/haskell/ohaskell-translation-tool $ ohaskell-translation-tool \u003c example.md |  languagetool -l en-GB -d EN_QUOTES                        \nExpected text language: English (GB)\nWorking on STDIN...\n1.) Line 9, column 9, Rule ID: EN_A_VS_AN\nMessage: Use 'an' instead of 'a' if the following word starts with a vowel sound, e.g. 'an article', 'an hour'\nSuggestion: an\nThat is a awesome funtion `input`:  \n        ^                           \n2.) Line 9, column 19, Rule ID: MORFOLOGIK_RULE_EN_GB\nMessage: Possible spelling mistake found\nSuggestion: function\nThat is a awesome funtion `input`:  \n                  ^^^^^^^           \nTime: 402ms for 4 sentences (10.0 sentences/sec)\n```\n\nHowever, not all mistakes can be found.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzudov%2Fohaskell-translation-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzudov%2Fohaskell-translation-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzudov%2Fohaskell-translation-tool/lists"}