Skip to content

Commit

Permalink
Remove a few irregularity markers and cover the conjugations with ano…
Browse files Browse the repository at this point in the history
…ther new made-up case. Naughty.
  • Loading branch information
Ben Smith committed Mar 30, 2013
1 parent d6e1b7c commit a0f850d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
4 changes: 2 additions & 2 deletions data/norsk_verbs.csv
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"røke","røker","røkte","har røkt","røk","Røk!","smoke (a cigarette)",
"røyke","røyker","røykte","har røykt","røyk","Røyk!","smoke (a cigarette)",
"se","ser","* så","har sett","se","Se!","see",
"selge","selger","* solgte","har solgt","selg","Selg!","sell",
"selge","selger","solgte","har solgt","selg","Selg!","sell",
"sende","sender","sendte","har sendt","send","Send!","send",
"sette","setter","* satte","har satt","sett","Sett!","set, place",
"si","* sier","* sa","har sagt","si","Si!","say, tell",
Expand Down Expand Up @@ -226,7 +226,7 @@
"tro","tror","trodde","har trodd","tro","Tro!","believe",
"tvile","tviler","tvilte","har tvilt","tvil","Tvil!","doubt",
"tvinge","tvinger","* tvang","har tvunget","tving","Tving!","force",
"velge","velger","* valgte","har valgt","velg","Velg!","choose, elect",
"velge","velger","valgte","har valgt","velg","Velg!","choose, elect",
"vente","venter","* ventet","har ventet","vent","Vent!","wait, expect",
"ville","* vil","* ville","har villet","vill","Vill!","want to, will",
"vinne","vinner","* vant","har vunnet","vinn","Vinn!","win, gain",
Expand Down
25 changes: 17 additions & 8 deletions lib/languages/norsk/past_tense.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

class NorskPastTense < NorskTense
@keys = "past", "fortid"
@class1 = /.*[bdfghjklmnprstvwz][bdfghjklmnprstvwz]$/
@class2a = /.*[aeiouyæøå](?:nn|mm|ll)$/
@class2b = /.*[aeiouyæøå](?:nd|ld)$/
@class2c = /.*[aeiouyæøå][bdfghjklmnprstvwz]$/
@class3 = /.*(?:ei|øy|au|oi|ai|g|v)$/
@class4 = /.*[b-df-hj-np-tv-z][aeiouyæøå]$/
@class1 = /.+[bdfghjklmnprstvwz][bdfhjklmnprstwz]$/
@class2a = /.+[aeiouyæøå](?:nn|mm|ll)$/
@class2b = /.+[aeiouyæøå](?:nd|ld)$/
@class2c = /.+[aeiouyæøå][bdfhjklmnprstwz]$/
@class2d = /.+lg$/
@class3 = /.+(?:ei|øy|au|oi|ai|g|v)$/
@class4 = /.*[bdfghjklmnprstvwz][aeiouyæøå]$/
@class5 = /^[bdfghjklmnprstvwz][bdfghjklmnprstvwz]$/

def self.specific_conjugation(verb)
stem = NorskStemTense.regular_conjugation(verb)
case stem

# Class 2: Stem ends in long vowel followed by a constonant. Should
# be suffixed with -te.
when @class2a then stem[0,stem.size-1] + "te"
when @class2b then stem + "te"
when @class2c then stem + "te"

when @class2d then stem + "te"

# Class 1: Stem ends in a double constonant. Should be suffixed with
# -et or -a. Run after class 2 as it can steal class 2 matches
# -et or -a. Run after class 2 as it can steal matches
# accidently.
when @class1 then [stem + "et", stem + "a"]

Expand All @@ -30,6 +34,11 @@ def self.specific_conjugation(verb)
# Class 4: Stem ends in a stressed vowel. Should be suffixed with
# -dde.
when @class4 then stem + "dde"

# Class 5: Stem is two constonants. I made this one up. Should be
# suffixed with -edde as far as I can see.
when @class5 then stem + "edde"

end
end
end
Loading

0 comments on commit a0f850d

Please sign in to comment.