russian_inflect 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTI0NjZlOWNhN2YyODc4YTk2NDBhOGZiMTgxY2IyMDUzNDI0MzljNw==
4
+ NGIyNWNlMTRmZGI3YzA5NmQ3YjE1YjlmZTA0MmMyMDVjMzM2MDViMQ==
5
5
  data.tar.gz: !binary |-
6
- MzI4MzI0OTE5NTRmMzg3NTI1YzU5ODc5NmUxNGM5ODU0ZGE2NDgwYw==
6
+ MzA5MTIzOGIyNTdkMmMyZmFlNzFjMTgyODQ3NmIwYTdjYzAyNTE4YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MDBkMTAzN2MyZDBlNTZlYzg4MDkyODkwMzMxMzc5ZDdkMDhmMjIzNmQzZDc2
10
- MDI1Mjg1MGVkMzZhODQ5ODI3OWU2Y2UzNGZlZDA0Y2MwODY2ZDM5ODQxOWFh
11
- NjMyM2M3MzQ1MTE4ZGRiMDFlZjI2ZDdiODhhMWYyMDMxOWUyODk=
9
+ MDY0MGIxZDA1ODQyOWU0NTI5OTNkODZlMjg1YWE0OThjYWEzMzU1YzFlM2Vl
10
+ YWZhNzlhZGM3Nzk5OWY3YTRkZGUwNTM3YmRhMzAyZTI5MmFhZjVlNjMxZmZh
11
+ NDNhZDRlYmU1NTUyMDhjZDQ1MTU3YWUzZGZiMjYyN2U3NTM3YTY=
12
12
  data.tar.gz: !binary |-
13
- YTJlOWQwMmQ1ODE4YjE0OWIxOTAzM2RmMDUwOWFiMzk5MGExM2MyMDFmMmM3
14
- YTQ3OWYzNDFkNzMwZDU5ZGI5YzZjM2FhOTZkNmZhOTdmYzgwNjUwYTAwMDkw
15
- YWQzOTQxZmY4OTNhODYyNjZkZmU2YzlkZjFmZDUwZGI5ZTZiMzE=
13
+ YjZjNDUxZjVjZDBjMTM1ZGQ0MWQ3NDk2OWMwYjBmNThjODIzZDFiNmFjNzY3
14
+ MDk0NjM2YTM5MDdhMDdkMzg1MTQ5MjMwYzAyOGZmNTk5ODkzMTI0YTc1OWFj
15
+ MjdjYWMyZGM1M2Y5MzE1NTVjZDE3ODkyNGU3ZDNiNWQ2ZDhjODk=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RussianInflect
2
2
 
3
- TODO: Write a gem description
3
+ Склонение по падежам заголовков на русском языке
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,12 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ RussianInflect.inflect("Хорошая погода", :nominative) # Хорошая погода
22
+ RussianInflect.inflect("Хорошая погода", :genitive) # Хорошой погоды
23
+ RussianInflect.inflect("Хорошая погода", :dative) # Хорошой погоде
24
+ RussianInflect.inflect("Хорошая погода", :accusative) # Хорошую погоду
25
+ RussianInflect.inflect("Хорошая погода", :instrumental) # Хорошой погодой
26
+ RussianInflect.inflect("Хорошая погода", :prepositional) # Хорошой погоде
22
27
 
23
28
  ## Contributing
24
29
 
@@ -15,8 +15,11 @@ first_group:
15
15
  noun:
16
16
  suffixes:
17
17
  -
18
- test: [а]
18
+ test: [га, ка, ха, ча]
19
19
  mods: [-и, -е, -у, -ой, -е]
20
+ -
21
+ test: [ба, ва, да, жа, за, ла, ма, на, па, ра, са, та, фа, ца]
22
+ mods: [-ы, -е, -у, -ой, -е]
20
23
  -
21
24
  test: [я]
22
25
  mods: [-и, -е, -ю, -ей, -е]
@@ -1,3 +1,3 @@
1
1
  class RussianInflect
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -46,6 +46,10 @@ class RussianInflect
46
46
  inflected_words.join(' ')
47
47
  end
48
48
 
49
+ def self.inflect(text, gcase)
50
+ self.new(text).to_case(gcase)
51
+ end
52
+
49
53
  def self.detect_case_group(noun)
50
54
  case noun
51
55
  when /(а|я|и)$/i then 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: russian_inflect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tõnis Simo