Jump to content

User:So9q

From Wikifunctions

More about me on meta.

I'm interested in functions for Swedish and other languages I know.

Shortcuts

Generic helper functions

Add string suffix if not already present

Replace suffix

Swedish

All functions with ✓ below have been created and implemented by me. :)

Verbs

Fyra grupper för konjugering

Helper functions

Group 1

E.g. titta -> tittar

Group 2

E.g. köra -> kör, ringa -> ringer, söka -> sökte

de verb som slutar på -te i preteritum är de som slutar på en av följande bokstäver: k, p, t, s eller x.

Group 3

E.g. bo -> bor/bodde/bott

Group 4

Oregelbundna

E.g. dricka -> dricker/drack/druckit E.g. böra -> bör/borde/bort

Nouns

The purpose of these declension functions is to cover all nouns in Swedish. The first six classes are borrowed from Svenska Akademiens språklära. Unfortunately none of them account for the nouns in the seventh - ninth classes below.

Since a few nouns have no plural forms and a few have multiple plural forms we recommend to call the helper functions below first to avoid erroneous output.

Swedish noun helper functions

First declension

E.g. gata -> gator

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun, first declension, definite singular, -n (Z17725) replace suffix "a" with "or" (Z17703) replace suffix "a" with "orna" (Z17915)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) add suffix "ns" to string if it does not end with "ns" (Z18066) replace suffix "a" with "ors" (Z18092) replace suffix "a" with "ornas" (Z17918)

Second declension

E.g. växel -> växlar

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun, second declension, definite singular, -en/-eln (Z17736) Swedish noun, second declension, indefinite plural, -ar/-rar (Z17721) Swedish noun, second declension, definite plural, -arna/-larna (Z17921)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) Swedish noun, second declension, definite singular genitive, -ens/-elns (Z18104) Swedish noun, second declension, indefinite plural genitive, -ars/-rars (Z18108) Swedish noun, second declension, definite plural genitive, -arnas/-larnas (Z17923)

Third declension

E.g. student -> studenter

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun, third declension, definite singular, -en/-len (Z17741) Swedish noun, third declension, indefinite plural, -er/-äder/-ter/-öcker (Z17745) Swedish noun, third declension, definite plural, -erna/-äderna/-terna/-öckna (Z17928)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) Swedish noun, third declension, definite singular genitive, -ens/-lens (Z18098) Swedish noun, third declension, indefinite plural genitive, -ers/-äders/-ters/-öckers (Z18101) Swedish noun, third declension, definite genitive plural, -ernas/-ädernas/-ternas/-öcknas (Z17934)

Fourth declension

E.g. fiende -> fiender

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun, fourth declension, singular definite, -n (Z17853) add suffix "r" to string if it does not end with "r" (Z17749) add suffix "rna" to string if it does not end with "rna" (Z17939)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) add suffix "ns" to string if it does not end with "ns" (Z18066) add suffix "rs" to end if string does not already end with "rs" (Z18095) add suffix "rnas" to string if it does not end with "rnas" (Z17942)

Fifth declension

E.g äpple -> äpplen

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - add suffix "t" to string if it does not end with "t" (Z17904) add suffix "n" to string if it does not already end with "n" (Z17791) add suffix "na" to string if it does not end with "na" (Z17946)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) add suffix "ts" to string if it does not already ends with "ts" (Z18017) add suffix "ns" to string if it does not end with "ns" (Z18066) add suffix "nas" to string if it does not already end with "nas" (Z17952)

Sixth declension

E.g. lärare, bord

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun declension, singular definite, -n/-et (Z17907) Swedish noun, sixth declension, indefinite plural (same as singular) (Z17783) Swedish noun, sixth declension, definite plural, -en/-rna (Z17966)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) Swedish noun, sixth declension, singular definite genitive -ns/-ets (Z18063) add suffix "s" to string if it does not already end with "s" (Z18020) Swedish noun, sixth declension, definite genitive plural, -ens/-rnas (Z17970)

Seventh (vovel shortening only) declension

I invented this class to account for mus -> möss and similar nouns.

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun declension, singular definite, -nen/-en (Z17911) Swedish noun declension, indefinite plural, irregular nouns with only shortening of vovel (umlaut) (Z17822) Swedish noun seventh declension plural definite umlaut + -en (Z18048)
Genitive (no change) string identity (Z11602) Swedish noun seventh declension singular definite genitive -sens/-nens (Z18045) Swedish noun declension, indefinite plural, irregular nouns with only shortening of vovel (umlaut) (Z17822) Swedish noun seventh declension plural definite umlaut + -ens (Z18055)

Eigth declension

I invented this class to account for öga -> ögon and similar nouns.

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - add suffix "t" to string if it does not end with "t" (Z17904) replace suffix "a" with "on" (Z17827) replace suffix "a" with "onen" (Z18012)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) add suffix "ts" to string if it does not already ends with "ts" (Z18017) replace suffix "a" with "ons" (Z18026) replace suffix "a" with "onens" (Z18023)

Ninth declension

I invented this class to account for huvud -> huvuden and similar nouns.

Case Singular Plural
Indefinite Definite Indefinite Definite
Nominative - Swedish noun declension, singular definite, -n/-et (Z17907) Swedish noun, ninth declension, indefinite plural, -en (Z17832) add suffix "ena" if string does not end with "ena" (Z18032)
Genitive add suffix "s" to string if it does not already end with "s" (Z18020) add suffix "ets" to string if it does not end with "ets" (Z18042) add suffix "ens" to string if it does not end with "ens" (Z18039) add suffix "enas" to string if it does not end with "enas" (Z18036)

Sources

Other functions

Affected by bugs or missing features

Affected by missing float type


Wikidata dependent functions

  • noun lexeme is endocentric compound? (Z18317): Accept a Lexeme ID, look it up in Wikidata and return True if P31→ statement is found, False if not. (takes LID, lookup in Wikidata and return True if P31-statement is found, False if not.
  • noun lexeme is exocentric compound? (takes LID, lookup in Wikidata and return True if P31-statement is found, False if not.
  • is noun lexeme? (Z19330): no description

Notes

  • {{section resolved|1=~~~~}}
  • {{Welcome/lang|user=|welcominguser=|1=~~~~}}