{"id":17685603,"url":"https://github.com/cmpadden/afinn.ts","last_synced_at":"2025-08-22T12:42:44.383Z","repository":{"id":74957630,"uuid":"462469801","full_name":"cmpadden/afinn.ts","owner":"cmpadden","description":"AFINN Sentiment Analysis Ported to Typescript","archived":false,"fork":false,"pushed_at":"2022-02-24T18:54:06.000Z","size":218,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T23:25:08.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cmpadden.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}},"created_at":"2022-02-22T20:50:07.000Z","updated_at":"2022-02-24T16:10:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"432e0a13-81d6-4a00-bc8d-18a64b3a1045","html_url":"https://github.com/cmpadden/afinn.ts","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/cmpadden%2Fafinn.ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fafinn.ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fafinn.ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fafinn.ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmpadden","download_url":"https://codeload.github.com/cmpadden/afinn.ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246375256,"owners_count":20767075,"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-24T10:28:23.272Z","updated_at":"2025-03-30T20:25:00.605Z","avatar_url":"https://github.com/cmpadden.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AFINN\n\n[![npm](https://img.shields.io/npm/v/afinn.ts)](https://www.npmjs.com/package/afinn.ts)\n[![Test](https://github.com/cmpadden/afinn.ts/workflows/Test/badge.svg)](https://github.com/cmpadden/afinn.ts/actions)\n\nAFINN sentiment analysis: a wordlist-based approach to sentiment analysis\nported from the [Python implementation](https://github.com/fnielsen/afinn) to Typescript.\n\n## Installation\n\n```\nyarn add afinn.ts\n```\n\n## Demo\n\nA demonstration of the `afinn.ts` module can be found in use at [https://cmpadden.github.io/afinn.ts-demo/](https://cmpadden.github.io/afinn.ts-demo/) with source code in the\n[cmpadden/afinn.ts-demo](https://github.com/cmpadden/afinn.ts-demo) repository.\n\n![demo](https://user-images.githubusercontent.com/5807118/155581484-b38ded81-596e-4bef-8888-90e01d36e400.png)\n\n## Examples\n\n```ts\nimport Afinn from \"afinn.ts\";\nconst afinn = Afinn({ language: \"en\" });\nafinn.score(\"This is utterly excellent!\");\n```\n\nIn Danish:\n\n```ts\nconst afinn = Afinn({ language: \"da\" });\nafinn.score(\"Hvis ikke det er det mest afskyelige flueknepperi...\");\n```\n\nIn Finnish:\n\n```ts\nconst afinn = Afinn({ language: \"fi\" });\nafinn.score(\"Siellä on uusi hyvä juttu, katsokaa ja kuunnelkaa ihmeessä.\");\n```\n\nIn Swedish:\n\n```ts\nconst afinn = Afinn({ language: \"sv\" });\nafinn.score(\"det är inte bra\");\n```\n\nIn Turkish:\n\n```ts\nconst afinn = Afinn({ language: \"tr\" });\nafinn.score(\"iyi de\\u011Fil\");\n```\n\n```ts\nconst afinn = Afinn({ language: \"tr\" });\nafinn.score(\"iyi değil\");\n```\n\nWith emoticons:\n\n```ts\nconst afinn = Afinn({ language: \"emoticons\" });\nafinn.score(\"I saw that yesterday :)\");\n```\n\n_NOTE:_ there are plans to add _emoticon_ support to all languages, as is done in the Python implementation.\n\n## Citation\n\nNielsen's original citation can be found here:\n\n\u003e Finn Årup Nielsen, \"A new ANEW: evaluation of a word list for sentiment analysis in microblogs\", Proceedings of the ESWC2011 Workshop on 'Making Sense of Microposts': Big things come in small packages. Volume 718 in CEUR Workshop Proceedings: 93-98. 2011 May. Matthew Rowe, Milan Stankovic, Aba-Sah Dadzie, Mariann Hardey (editors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmpadden%2Fafinn.ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmpadden%2Fafinn.ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmpadden%2Fafinn.ts/lists"}