module Hunspell

Defined in:

hunspell.cr
hunspell/dictionary.cr

Constant Summary

DEFAULT_LANG = ((ENV.fetch("LANG", "en_US.UTF-8")).split('.', 2)).first

The language to default to, if no 'LANG' env variable was set.

KNOWN_DIRECTORIES = [File.join(Path.home, USER_DIR), File.join(Path.home, "Library/Spelling"), "/Library/Spelling", "/usr/local/share/myspell/dicts", "/usr/share/myspell/dicts", "/usr/share/hunspell", "/usr/local/share/myspell", "/usr/share/myspell", "/opt/local/share/hunspell", "/opt/share/hunspell"]

Known directories to search within for dictionaries.

USER_DIR = ".hunspell_default"

The directory name used to store user installed dictionaries.

Class Method Summary

Class Method Detail

def self.dict(name = self.lang) : Dictionary #

Opens a Hunspell dictionary.

@param [Symbol, String] name The name of the dictionary to open.

@return [nil]


[View source]
def self.dict(name = self.lang, &block : Dictionary -> ) #

Opens a Hunspell dictionary.

@param [Symbol, String] name The name of the dictionary to open.

@yield [dict] The given block will be passed the Hunspell dictionary.

@yieldparam [Dictionary] dict The opened dictionary.

@return [nil]


[View source]
def self.directories : Array(String) #

The dictionary directories to search for dictionary files.

@return [Array<String, Pathname>] The directory paths.

@since 0.2.0


[View source]
def self.directories=(directories : Array(String)) #

The dictionary directories to search for dictionary files.

@return [Array<String, Pathname>] The directory paths.

@since 0.2.0


[View source]
def self.lang : String #

The default language.

@return [String] The name of the default language.


[View source]
def self.lang=(lang : String) #

The default language.

@return [String] The name of the default language.


[View source]