Language (afinn v0.3.0)
Handles loading and parsing of AFINN sentiment dictionaries for different languages.
This module provides functionality to read AFINN dictionary files and convert them into maps for efficient sentiment lookups.
Summary
Functions
Reads and parses the AFINN dictionary for the specified language.
Functions
@spec read_dictionaries(:en | :dk | :fi | :fr | :pl | :sv | :tr | :emoticon) :: %{ required(String.t()) => integer() }
Reads and parses the AFINN dictionary for the specified language.
Parameters
language- Language identifier (:enfor English,:dkfor Danish,:fifor Finnish,:frfor French,:plfor Polish,:svfor Swedish,:trfor Turkish,:emoticonfor Emoticons)
Returns
A map where keys are words (strings) and values are sentiment scores (integers).
Examples
iex> dict = Language.read_dictionaries(:en)
iex> Map.get(dict, "love")
3