README.adoc in human_languages-0.6.0 vs README.adoc in human_languages-0.7.0
- old
+ new
@@ -3,11 +3,11 @@
:source-language: ruby
image:https://api.reuse.software/badge/github.com/bbenno/languages[link="https://api.reuse.software/info/github.com/bbenno/languages", alt="REUSE status"]
image:https://badge.fury.io/rb/human_languages.svg["Gem Version", link="https://badge.fury.io/rb/human_languages"]
-image:https://img.shields.io/maintenance/yes/2022[Maintenance]
+image:https://img.shields.io/maintenance/yes/2023[Maintenance]
image:https://github.com/bbenno/languages/actions/workflows/main.yml/badge.svg[link="https://github.com/bbenno/languages/actions/workflows/main.yml"]
Simple, dependency-less gem providing all known human languagesfootnote:[This includes all individual languages already accounted for in ISO 639-2 as well as extinct, ancient, constructed, and historical languages.] defined in ISO 639-3
The ISO code set in link:data/[data/] is taken from the official ISO 639-3 registration authority (ISO 639-3/RA) https://iso639-3.sil.org/[SIL International].
@@ -15,21 +15,21 @@
== Installation
Add this line to your application’s Gemfile:
[source]
----
-gem 'languages'
+gem 'human_languages'
----
And then execute:
....
$ bundle install
....
Or install it yourself as:
....
-$ gem install languages
+$ gem install human_languages
....
== Usage
.Foremost, load the gem
@@ -63,11 +63,17 @@
----
Languages.search "^Germ"
Languages.search /\AJapan/
----
-CAUTION: `Languages.search` is case-sensitive unless specified explicitly, e.g. using `/search_pattern/i`.
+[CAUTION]
+--
+Passing a string to `Languages.search` results in case-sensitive search.
+If case-insensitive search is intended, use ignorecase regexp like `/search_pattern/i` or pass optional `case_sensitive` parameter.
+[source]
+Languages.search('search_pattern', case_sensitive: false)
+--
.Since ISO 639-3 categorizes the languages by scope and type, one can filter by them
[source]
----
# By scope
@@ -106,9 +112,69 @@
language.extinct? # => false
language.living? # => true
language.individual_language? # => true
----
+
+Some languages of scope `individual` have a reference to their macrolanguage (scope `macrolanguage) that they belong to.
+More information on macrolanguages can be found https://iso639-3.sil.org/about/scope#Macrolanguages[here].
+
+[source]
+----
+language = Language[:wuu]
+language.individual_language? # => true
+
+macrolanguage = language.macrolanguage
+
+macrolanguage.alpha3 # => "zho"
+macrolanguage.name # => "Chinese"
+macrolanguage.scope # => :macrolanguage
+macrolanguage.macrolanguage # => nil
+----
+
+== Related Gems and Differences
+
+Why to build another gem for ISO 639?
+
+.Overview
+[%header,cols="2,1,2,2,3"]
+|===
+|Gem
+|ISO 639-1/-2
+|ISO 639-3
+|Translations
+|Data Storage
+
+|https://rubygems.org/gems/iso639[iso639]
+|✅
+|❌
+|French
+|Collection of Hashes
+
+|https://rubygems.org/gems/iso-639[iso-639]
+|✅
+|❌
+|French
+|Array of Arrays
+
+|https://rubygems.org/gems/iso-639-data[iso-639-data]
+|✅
+|(✅) only scope individual
+|French for ISO 639-2
+|Hash of Hashes
+
+|https://rubygems.org/gems/language_list[language_list]
+|✅
+|(✅) only scope individual
+|-
+|Array of Language-Objects
+
+|https://rubygems.org/gems/human_languages[human_languages]
+|✅
+|✅
+|-
+|Array of Language-Objects
+|===
== Development
After checking out the repo, run `bin/setup` to install dependencies.
Then, run `rake test` to run the tests.