diff options
| author | aarne <aarne@chalmers.se> | 2009-12-09 09:47:16 +0000 |
|---|---|---|
| committer | aarne <aarne@chalmers.se> | 2009-12-09 09:47:16 +0000 |
| commit | c8ceed08efcc0bdc1fcbd89bce643d9f52f0991b (patch) | |
| tree | 5f0b314341c129eba1bc67b8b887fb8a4486fad8 /deprecated/old-lib/resource/common | |
| parent | 101df06f6c8380328d4266adadac3ab6d1bac0b3 (diff) | |
moving a few things to deprecated
Diffstat (limited to 'deprecated/old-lib/resource/common')
| -rw-r--r-- | deprecated/old-lib/resource/common/CommonX.gf | 31 | ||||
| -rw-r--r-- | deprecated/old-lib/resource/common/ConstructX.gf | 19 | ||||
| -rw-r--r-- | deprecated/old-lib/resource/common/ParamX.gf | 65 | ||||
| -rw-r--r-- | deprecated/old-lib/resource/common/TenseX.gf | 18 | ||||
| -rw-r--r-- | deprecated/old-lib/resource/common/TextX.gf | 11 |
5 files changed, 144 insertions, 0 deletions
diff --git a/deprecated/old-lib/resource/common/CommonX.gf b/deprecated/old-lib/resource/common/CommonX.gf new file mode 100644 index 000000000..bcaf1e4b9 --- /dev/null +++ b/deprecated/old-lib/resource/common/CommonX.gf @@ -0,0 +1,31 @@ +concrete CommonX of Common = open (R = ParamX) in { + + lincat + Text = {s : Str} ; --lock_Text : {}} ; + Phr = {s : Str} ; --lock_Phr : {}} ; + Utt = {s : Str} ; --lock_Utt : {}} ; + Voc = {s : Str} ; --lock_Voc : {}} ; + SC = {s : Str} ; --lock_SC : {}} ; + Adv = {s : Str} ; --lock_Adv : {}} ; + AdV = {s : Str} ; --lock_AdV : {}} ; + AdA = {s : Str} ; --lock_AdA : {}} ; + AdN = {s : Str} ; --lock_AdN : {}} ; + IAdv = {s : Str} ; --lock_IAdv : {}} ; + CAdv = {s : Str} ; --lock_CAdv : {}} ; + PConj = {s : Str} ; --lock_PConj : {}} ; + + Tense = {s : Str ; t : R.Tense} ; + Ant = {s : Str ; a : R.Anteriority} ; + Pol = {s : Str ; p : R.Polarity} ; + + lin + PPos = {s = []} ** {p = R.Pos} ; + PNeg = {s = []} ** {p = R.Neg} ; + TPres = {s = []} ** {t = R.Pres} ; + TPast = {s = []} ** {t = R.Past} ; --# notpresent + TFut = {s = []} ** {t = R.Fut} ; --# notpresent + TCond = {s = []} ** {t = R.Cond} ; --# notpresent + ASimul = {s = []} ** {a = R.Simul} ; + AAnter = {s = []} ** {a = R.Anter} ; --# notpresent + +} diff --git a/deprecated/old-lib/resource/common/ConstructX.gf b/deprecated/old-lib/resource/common/ConstructX.gf new file mode 100644 index 000000000..ee4decf00 --- /dev/null +++ b/deprecated/old-lib/resource/common/ConstructX.gf @@ -0,0 +1,19 @@ +--# -path=.:../abstract:prelude + +resource ConstructX = open CommonX in { + + oper + mkText : Str -> Text = \s -> {s = s ; lock_Text = <>} ; + mkPhr : Str -> Phr = \s -> {s = s ; lock_Phr = <>} ; + mkUtt : Str -> Utt = \s -> {s = s ; lock_Utt = <>} ; + mkVoc : Str -> Voc = \s -> {s = s ; lock_Voc = <>} ; + mkSC : Str -> SC = \s -> {s = s ; lock_SC = <>} ; + mkAdv : Str -> Adv = \s -> {s = s ; lock_Adv = <>} ; + mkAdV : Str -> AdV = \s -> {s = s ; lock_AdV = <>} ; + mkAdA : Str -> AdA = \s -> {s = s ; lock_AdA = <>} ; + mkAdN : Str -> AdN = \s -> {s = s ; lock_AdN = <>} ; + mkIAdv : Str -> IAdv = \s -> {s = s ; lock_IAdv = <>} ; + mkCAdv : Str -> CAdv = \s -> {s = s ; lock_CAdv = <>} ; + mkPConj : Str -> PConj = \s -> {s = s ; lock_PConj = <>} ; + +} diff --git a/deprecated/old-lib/resource/common/ParamX.gf b/deprecated/old-lib/resource/common/ParamX.gf new file mode 100644 index 000000000..65901de66 --- /dev/null +++ b/deprecated/old-lib/resource/common/ParamX.gf @@ -0,0 +1,65 @@ +resource ParamX = open Prelude in { + +---- flags optimize=noexpand ; + + param + Number = Sg | Pl ; + Person = P1 | P2 | P3 ; + Degree = Posit | Compar | Superl ; + + Anteriority = + Simul + | Anter --# notpresent + ; + Tense = + Pres + | Past --# notpresent + | Fut --# notpresent + | Cond --# notpresent + ; + + param + + Polarity = Pos | Neg ; + + QForm = QDir | QIndir ; + +-- Imperatives: True = polite, False = familiar. + + ImpForm = ImpF Number Bool ; + + oper + numImp : ImpForm -> Number = \i -> + case i of { + ImpF n _ => n + } ; + + conjNumber : Number -> Number -> Number = \m,n -> + case m of { + Sg => n ; + _ => Pl + } ; + +-- For persons, we let the latter argument win ("either you or I am absent" +-- but "either I or you are absent"). This is not quite clear. + + conjPerson : Person -> Person -> Person = \_,p -> + p ; + +-- To construct a record with a polarity-dependent table. + + polCases : SS -> SS -> {s : Polarity => Str} = \true,false -> { + s = table { + Pos => true.s ; + Neg => false.s + } + } ; + +-- To count the length of a tail in a sequence of digits, e.g. to put commas +-- as in 1,000,000. + + param + DTail = T1 | T2 | T3 ; + + +} diff --git a/deprecated/old-lib/resource/common/TenseX.gf b/deprecated/old-lib/resource/common/TenseX.gf new file mode 100644 index 000000000..665bb146d --- /dev/null +++ b/deprecated/old-lib/resource/common/TenseX.gf @@ -0,0 +1,18 @@ +concrete TenseX of Tense = open (R = ParamX) in { + + lincat + Tense = {s : Str ; t : R.Tense} ; + Ant = {s : Str ; a : R.Anteriority} ; + Pol = {s : Str ; p : R.Polarity} ; + + lin + PPos = {s = []} ** {p = R.Pos} ; + PNeg = {s = []} ** {p = R.Neg} ; + TPres = {s = []} ** {t = R.Pres} ; + TPast = {s = []} ** {t = R.Past} ; + TFut = {s = []} ** {t = R.Fut} ; + TCond = {s = []} ** {t = R.Cond} ; + ASimul = {s = []} ** {a = R.Simul} ; + AAnter = {s = []} ** {a = R.Anter} ; + +} diff --git a/deprecated/old-lib/resource/common/TextX.gf b/deprecated/old-lib/resource/common/TextX.gf new file mode 100644 index 000000000..a5ddebc54 --- /dev/null +++ b/deprecated/old-lib/resource/common/TextX.gf @@ -0,0 +1,11 @@ +concrete TextX of Text = CommonX ** { + +-- This will work for almost all languages except Spanish. + + lin + TEmpty = {s = []} ; + TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + +} |
