{"id":25178122,"url":"https://github.com/sgb-io/sweary-linus","last_synced_at":"2025-06-11T00:33:50.169Z","repository":{"id":148995221,"uuid":"125857867","full_name":"sgb-io/sweary-linus","owner":"sgb-io","description":"A learning exercise about programming languages and styles, featuring sweary wizard-man Linus Torvalds.","archived":false,"fork":false,"pushed_at":"2018-08-29T16:00:35.000Z","size":1328,"stargazers_count":8,"open_issues_count":22,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T03:08:35.984Z","etag":null,"topics":["exercise","fun","learning"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/sgb-io.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-19T12:58:41.000Z","updated_at":"2023-03-04T04:12:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc4556ba-b0d4-419c-a573-be1d4c2e6cff","html_url":"https://github.com/sgb-io/sweary-linus","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/sgb-io%2Fsweary-linus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgb-io%2Fsweary-linus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgb-io%2Fsweary-linus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgb-io%2Fsweary-linus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgb-io","download_url":"https://codeload.github.com/sgb-io/sweary-linus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgb-io%2Fsweary-linus/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259175939,"owners_count":22817086,"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":["exercise","fun","learning"],"created_at":"2025-02-09T14:52:31.390Z","updated_at":"2025-06-11T00:33:50.155Z","avatar_url":"https://github.com/sgb-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sweary Linus\n\nThis project contains implementations of a simple program in various different programming languages and programming styles. It is used as a personal learning exersize.\n\nIt was inspired by [Exercises in Programming Style by Cristina Videira Lopes](https://www.amazon.com/Exercises-Programming-Style-Cristina-Videira/dp/1482227371/) via [Henrik Warne's blog post](https://henrikwarne.com/2018/03/13/exercises-in-programming-style/).\n\n## The Program\n\nThe program counts the occurrences of words (term frequencies) in a file. The sample input is a list of [Linus Torvalds insults](https://en.wikiquote.org/wiki/Linus_Torvalds).\n\nThe program should:\n  - Read the insults file and turn into individual words\n  - Read the stop words file and turn into individual words\n  - Lower-case the words\n  - Remove non-letter characters (english alphabet only)\n  - Remove stop words (“the”, “a”, “for” etc) (note: stop words _do_ contain non-alphanumerics e.g. `don't`)\n  - Count the occurrences of all words\n  - Sort the list by number of occurences then alphabetically\n  - Finally, print out the 25 most common words in order\n  - The output should match exactly as below\n\n## Expected output\n\n```\n#1 - \"just\", 196 occurrences\n#2 - \"crap\", 120 occurrences\n#3 - \"code\", 113 occurrences\n#4 - \"wrong\", 86 occurrences\n#5 - \"stop\", 85 occurrences\n#6 - \"really\", 84 occurrences\n#7 - \"stupid\", 77 occurrences\n#8 - \"like\", 71 occurrences\n#9 - \"even\", 70 occurrences\n#10 - \"fcking\", 63 occurrences\n#11 - \"people\", 61 occurrences\n#12 - \"make\", 58 occurrences\n#13 - \"broken\", 56 occurrences\n#14 - \"patch\", 52 occurrences\n#15 - \"think\", 50 occurrences\n#16 - \"shit\", 49 occurrences\n#17 - \"thing\", 48 occurrences\n#18 - \"pure\", 46 occurrences\n#19 - \"can\", 44 occurrences\n#20 - \"things\", 44 occurrences\n#21 - \"fix\", 41 occurrences\n#22 - \"idiotic\", 41 occurrences\n#23 - \"whole\", 41 occurrences\n#24 - \"kind\", 40 occurrences\n#25 - \"actually\", 38 occurrences\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgb-io%2Fsweary-linus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgb-io%2Fsweary-linus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgb-io%2Fsweary-linus/lists"}