czech_declensions 0.1.0 → 0.1.1

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.
@@ -548,6 +548,7 @@ module CzechDeclensions
548
548
  @v3 << "zoe"
549
549
 
550
550
  @astrtvar = []
551
+ @vysledek = []
551
552
  @prefrod = "0"
552
553
 
553
554
  @ncmpreg = 0
@@ -559,8 +560,8 @@ module CzechDeclensions
559
560
  def self.sklonovani(slovo,pad)
560
561
  initialize
561
562
  on_sklonuj(slovo)
562
- #puts @astrtvar.inspect
563
- return @astrtvar[pad]
563
+ #puts @vysledek.inspect
564
+ return @vysledek[pad]
564
565
  end
565
566
 
566
567
  def self.on_sklonuj(vstup)
@@ -570,13 +571,21 @@ module CzechDeclensions
570
571
  # vysklonovani
571
572
  CzechDeclensions.skl2(slovo)
572
573
  # vynuceni rodu podle posledniho slova
573
- @prefrod = @astrtvar[0][0] if slovo == slova.first
574
+ @prefrod = @astrtvar[0][0] if slovo == slova.reverse.first
574
575
  # pokud nenajdeme vzor tak nesklonujeme
575
576
  if slovo != slova.first && @astrtvar[0][0] == '?' && @prefrod[0] != '?'
576
577
  for j in 1..14 do
577
578
  @astrtvar[j] = slovo
578
579
  end
579
580
  end
581
+ for i in 0..14 do
582
+ if @vysledek[i].nil?
583
+ @vysledek[i] = @astrtvar[i]
584
+ else
585
+ @vysledek[i] = @astrtvar[i] + " " + @vysledek[i]
586
+ end
587
+ end
588
+ #puts @astrtvar.inspect
580
589
  end
581
590
  end
582
591
 
@@ -1,3 +1,3 @@
1
1
  module CzechDeclensions
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/readme.md CHANGED
@@ -23,7 +23,7 @@ Alternatively, add the following to your Gemfile
23
23
 
24
24
  ## Usage
25
25
 
26
- slovo = sklonovani("moje slovo",2) => "mojeho slova"
26
+ slovo = CzechDeclensions.sklonovani("moje slovo",2) => "mojeho slova"
27
27
 
28
28
  ## Contributing
29
29
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: czech_declensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-27 00:00:00.000000000Z
12
+ date: 2012-07-31 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: Tool for czech declensions
15
15
  email: