declension 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +47 -0
- data/lib/declension/languages/lv.rb +3 -1
- data/lib/declension/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 993b0cb44402c3b6eabb5883ccb42a4a9400bcc7
|
|
4
|
+
data.tar.gz: 29b156f515a9309975888234fb460c86403f4a55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b44acd55bc0074c5167385e8a9d8eeca43559ace0530d63973b10c34ee5ca79cb5963cc9bdbd76e33a8438fb14bc717b5d20db399addfa77d371b0715db1fd6f
|
|
7
|
+
data.tar.gz: 13a4661324e6f351b1dbbc5a8e8897061689e62458dd7145b1998c939befecb8e038ad60769c26231f567f157e62c3beba289421ad4b8f4983765ba1c2b4ac9e
|
data/CHANGELOG.md
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2014-2015 Miks Mikelsons
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
== declension
|
|
2
|
+
|
|
3
|
+
{<img src="https://secure.travis-ci.org/miks/declension.png?branch=master" />}[http://travis-ci.org/miks/declension]
|
|
4
|
+
|
|
5
|
+
Inflect string according to current I18n.locale.
|
|
6
|
+
|
|
7
|
+
== Supported Languages
|
|
8
|
+
|
|
9
|
+
* Latvian [lv]
|
|
10
|
+
|
|
11
|
+
== Examples
|
|
12
|
+
|
|
13
|
+
"Jānis Ozols".inflect(:genitive, as: :male)
|
|
14
|
+
=> "Jāņa Ozola"
|
|
15
|
+
|
|
16
|
+
"automašīna".inflect(:instrumental, as: :female)
|
|
17
|
+
=> "ar automašīnu"
|
|
18
|
+
|
|
19
|
+
"Roberts Egle".inflect(:dative, as: :male)
|
|
20
|
+
=> "Robertam Eglem"
|
|
21
|
+
|
|
22
|
+
"Jana Egle".inflect(:dative, as: :female)
|
|
23
|
+
=> "Janai Eglei"
|
|
24
|
+
|
|
25
|
+
== Requirements
|
|
26
|
+
|
|
27
|
+
* 2.0.0 <= Ruby
|
|
28
|
+
|
|
29
|
+
== Installation
|
|
30
|
+
|
|
31
|
+
gem install declension
|
|
32
|
+
|
|
33
|
+
== License
|
|
34
|
+
|
|
35
|
+
MIT License
|
|
36
|
+
|
|
37
|
+
== Bugs and Language Support
|
|
38
|
+
|
|
39
|
+
See CHANGELOG.md for last changes.
|
|
40
|
+
|
|
41
|
+
Fork the project. Make your feature addition or bug fix with tests.
|
|
42
|
+
|
|
43
|
+
Send a pull request. Bonus points for topic branches.
|
|
44
|
+
|
|
45
|
+
== Contacts
|
|
46
|
+
|
|
47
|
+
* Miks Miķelsons (link:http://github.com/miks)
|
|
@@ -21,7 +21,7 @@ module Declension
|
|
|
21
21
|
raise ArgumentError, "No valid gender specified"
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
self.word_base = word[0..-(ending.length + 1)]
|
|
24
|
+
self.word_base = word[0..-(ending.length + 1)] if declension
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def analyze_male_gender_word
|
|
@@ -86,6 +86,8 @@ module Declension
|
|
|
86
86
|
fifth_declension(grammar_case, options = {})
|
|
87
87
|
elsif declension == 6
|
|
88
88
|
sixth_declension(grammar_case, options = {})
|
|
89
|
+
else
|
|
90
|
+
word
|
|
89
91
|
end
|
|
90
92
|
end
|
|
91
93
|
|
data/lib/declension/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: declension
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miks Mikelsons
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-04-
|
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: i18n
|
|
@@ -70,8 +70,14 @@ description: Apply grammatical cases to words.
|
|
|
70
70
|
email: miks.mikelsons@gmail.com
|
|
71
71
|
executables: []
|
|
72
72
|
extensions: []
|
|
73
|
-
extra_rdoc_files:
|
|
73
|
+
extra_rdoc_files:
|
|
74
|
+
- CHANGELOG.md
|
|
75
|
+
- LICENSE.txt
|
|
76
|
+
- README.rdoc
|
|
74
77
|
files:
|
|
78
|
+
- CHANGELOG.md
|
|
79
|
+
- LICENSE.txt
|
|
80
|
+
- README.rdoc
|
|
75
81
|
- lib/declension.rb
|
|
76
82
|
- lib/declension/cases.rb
|
|
77
83
|
- lib/declension/core_ext.rb
|