Class: Kotoshu::Languages::Arabic
- Inherits:
-
Kotoshu::Language::Base
- Object
- Kotoshu::Language::Base
- Kotoshu::Languages::Arabic
- Defined in:
- lib/kotoshu/languages/ar/language.rb
Overview
Arabic language implementation.
Registers the Arabic language with Kotoshu::Language::Registry under the
ar and ar-SA codes. Uses the Kotoshu::Language::Normalizer::Arabic
normalizer (NFC + presentation-form canonicalization + tashkeel
stripping) so that the same word typed in different input
methods produces the same normalized form for dictionary lookup.
Defined Under Namespace
Classes: Tokenizer
Instance Attribute Summary
Attributes inherited from Kotoshu::Language::Base
#code, #name, #region, #variant
Instance Method Summary collapse
- #default_dictionary_paths ⇒ Object
- #description ⇒ Object
- #dictionary_class ⇒ Object
-
#initialize(code: "ar", name: "Arabic", variant: nil) ⇒ Arabic
constructor
A new instance of Arabic.
- #normalizer ⇒ Object
-
#rtl? ⇒ Boolean
Arabic is written right-to-left.
- #script_type ⇒ Object
- #tokenizer ⇒ Object
Methods inherited from Kotoshu::Language::Base
#base_code, #base_language?, #compatible_with?, #encoding, #full_name, #info, instance, #matches_code?, #normalize, #normalize_word, #region_code, register, registered_codes, #tokenize, #valid_word?
Constructor Details
#initialize(code: "ar", name: "Arabic", variant: nil) ⇒ Arabic
Returns a new instance of Arabic.
21 22 23 |
# File 'lib/kotoshu/languages/ar/language.rb', line 21 def initialize(code: "ar", name: "Arabic", variant: nil) super end |
Instance Method Details
#default_dictionary_paths ⇒ Object
41 42 43 |
# File 'lib/kotoshu/languages/ar/language.rb', line 41 def default_dictionary_paths ["/usr/share/dict/arabic"] end |
#description ⇒ Object
25 26 27 |
# File 'lib/kotoshu/languages/ar/language.rb', line 25 def description name end |
#dictionary_class ⇒ Object
37 38 39 |
# File 'lib/kotoshu/languages/ar/language.rb', line 37 def dictionary_class Dictionary::Custom end |
#normalizer ⇒ Object
33 34 35 |
# File 'lib/kotoshu/languages/ar/language.rb', line 33 def normalizer @normalizer ||= Language::Normalizer::Arabic.new end |
#rtl? ⇒ Boolean
Arabic is written right-to-left.
50 51 52 |
# File 'lib/kotoshu/languages/ar/language.rb', line 50 def rtl? true end |
#script_type ⇒ Object
45 46 47 |
# File 'lib/kotoshu/languages/ar/language.rb', line 45 def script_type :arabic end |