forked from GitHub/gf-rgl
(Fin) Allow punctuation after abbreviations
This commit is contained in:
@@ -288,8 +288,18 @@ resource MorphoFin = ResFin ** open Prelude in {
|
||||
(jalaksi + "n" + a) (jalaksi + "ss" + a) (jalaksi + "in") ;
|
||||
|
||||
dSDP : Str -> NForms = \SDP ->
|
||||
let
|
||||
c = case Predef.toUpper (last SDP) of {
|
||||
let c : Str*Str*Str*Str*Str*Str*Str*Str*Str = case SDP of {
|
||||
_ + P@? + (")"|"]"|"!"|"?"|"-") -- ignore punctuation after vowel, e.g. Poly(A):n
|
||||
=> getCases P SDP ;
|
||||
_ + P@? => getCases P SDP } ;
|
||||
in nForms10
|
||||
SDP (SDP + ":" + c.p1) (SDP + ":" + c.p2) (SDP + ":" + c.p3)
|
||||
(SDP + ":" + c.p4) (SDP + ":" + c.p5) (SDP + ":" + c.p6)
|
||||
(SDP + ":" + c.p7) (SDP + ":" + c.p8) (SDP + ":" + c.p9) ;
|
||||
|
||||
-- Helper function for dSDP
|
||||
getCases : Str -> Str -> Str*Str*Str*Str*Str*Str*Str*Str*Str ;
|
||||
getCases c errorMsg = case Predef.toUpper c of {
|
||||
"A" =>
|
||||
<"n","ta","na","han","iden","ita","ina","issa","ihin"> ;
|
||||
"B" | "C" | "D" | "E" | "G" | "P" | "T" | "V" | "W" =>
|
||||
@@ -310,12 +320,8 @@ resource MorphoFin = ResFin ** open Prelude in {
|
||||
<"n","tä","nä","hön","iden","itä","inä","issä","ihin"> ;
|
||||
"Y" =>
|
||||
<"n","tä","nä","hyn","iden","itä","inä","issä","ihin"> ;
|
||||
_ => Predef.error (["illegal abbreviation"] ++ SDP)
|
||||
} ;
|
||||
in nForms10
|
||||
SDP (SDP + ":" + c.p1) (SDP + ":" + c.p2) (SDP + ":" + c.p3)
|
||||
(SDP + ":" + c.p4) (SDP + ":" + c.p5) (SDP + ":" + c.p6)
|
||||
(SDP + ":" + c.p7) (SDP + ":" + c.p8) (SDP + ":" + c.p9) ;
|
||||
_ => Predef.error (["illegal abbreviation"] ++ errorMsg) } ;
|
||||
|
||||
|
||||
-- for adjective comparison
|
||||
|
||||
|
||||
Reference in New Issue
Block a user