From 4f6bd2f1d6b1dfd34b16a8b59078034a2dde3aef Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 23 Oct 2009 15:34:09 +0000 Subject: [PATCH] add API modules for Polish --- lib/src/api/CombinatorsPol.gf | 6 +++++ lib/src/api/ConstructorsPol.gf | 3 +++ lib/src/api/SyntaxPol.gf | 5 ++++ lib/src/api/TryPol.gf | 12 ++++++++++ lib/src/polish/AllPol.gf | 5 ++++ lib/src/polish/AllPolAbs.gf | 5 ++++ lib/src/polish/SymbolPol.gf | 44 ++++++++++++++++++++++++++++++++++ 7 files changed, 80 insertions(+) create mode 100644 lib/src/api/CombinatorsPol.gf create mode 100644 lib/src/api/ConstructorsPol.gf create mode 100644 lib/src/api/SyntaxPol.gf create mode 100644 lib/src/api/TryPol.gf create mode 100644 lib/src/polish/AllPol.gf create mode 100644 lib/src/polish/AllPolAbs.gf create mode 100644 lib/src/polish/SymbolPol.gf diff --git a/lib/src/api/CombinatorsPol.gf b/lib/src/api/CombinatorsPol.gf new file mode 100644 index 000000000..c91bc2699 --- /dev/null +++ b/lib/src/api/CombinatorsPol.gf @@ -0,0 +1,6 @@ +--# -path=.:alltenses:prelude + +resource CombinatorsPol = Combinators with + (Cat = CatPol), + (Structural = StructuralPol), + (Constructors = ConstructorsPol) ; diff --git a/lib/src/api/ConstructorsPol.gf b/lib/src/api/ConstructorsPol.gf new file mode 100644 index 000000000..7a77b1ecc --- /dev/null +++ b/lib/src/api/ConstructorsPol.gf @@ -0,0 +1,3 @@ +--# -path=.:alltenses:prelude + +resource ConstructorsPol = Constructors with (Grammar = GrammarPol) ; diff --git a/lib/src/api/SyntaxPol.gf b/lib/src/api/SyntaxPol.gf new file mode 100644 index 000000000..6d7f6b572 --- /dev/null +++ b/lib/src/api/SyntaxPol.gf @@ -0,0 +1,5 @@ +--# -path=.:alltenses:prelude + +instance SyntaxPol of Syntax = + ConstructorsPol, CatPol, StructuralPol, CombinatorsPol ; + diff --git a/lib/src/api/TryPol.gf b/lib/src/api/TryPol.gf new file mode 100644 index 000000000..73c88ebc1 --- /dev/null +++ b/lib/src/api/TryPol.gf @@ -0,0 +1,12 @@ +--# -path=.:alltenses:prelude + +resource TryPol = SyntaxPol, LexiconPol, ParadigmsPol - [mkAdv] ** + open (P = ParadigmsPol) in { + +oper + + mkAdv = overload SyntaxPol { + mkAdv : Str -> Adv = P.mkAdv ; + } ; + +} diff --git a/lib/src/polish/AllPol.gf b/lib/src/polish/AllPol.gf new file mode 100644 index 000000000..b3953ead8 --- /dev/null +++ b/lib/src/polish/AllPol.gf @@ -0,0 +1,5 @@ +--# -path=.:../abstract:../common:prelude + +concrete AllPol of AllPolAbs = + LangPol + ** {} ; diff --git a/lib/src/polish/AllPolAbs.gf b/lib/src/polish/AllPolAbs.gf new file mode 100644 index 000000000..c999c0bec --- /dev/null +++ b/lib/src/polish/AllPolAbs.gf @@ -0,0 +1,5 @@ +--# -path=.:../abstract:../common:prelude + +abstract AllPolAbs = + Lang + ** {} ; diff --git a/lib/src/polish/SymbolPol.gf b/lib/src/polish/SymbolPol.gf new file mode 100644 index 000000000..ea0342487 --- /dev/null +++ b/lib/src/polish/SymbolPol.gf @@ -0,0 +1,44 @@ +--# -path=.:../abstract:../common + +concrete SymbolPol of Symbol = CatPol ** open Prelude, ResPol in { +{- +lin + SymbPN i = {s = addGenitiveS i.s ; g = Neutr} ; + IntPN i = {s = addGenitiveS i.s ; g = Neutr} ; + FloatPN i = {s = addGenitiveS i.s ; g = Neutr} ; + NumPN i = {s = i.s ; g = Neutr} ; + CNIntNP cn i = { + s = \\c => cn.s ! Sg ! Nom ++ (addGenitiveS i.s) ! c ; + a = agrgP3 Sg cn.g + } ; + CNSymbNP det cn xs = { + s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! c ; + a = agrgP3 det.n cn.g + } ; + CNNumNP cn i = { + s = \\c => cn.s ! Sg ! Nom ++ i.s ! c ; + a = agrgP3 Sg cn.g + } ; + + SymbS sy = sy ; + + SymbNum sy = { s = addGenitiveS sy.s ; n = Pl ; hasCard = True } ; + SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ; + +lincat + + Symb, [Symb] = SS ; + +lin + MkSymb s = s ; + + BaseSymb = infixSS "and" ; + ConsSymb = infixSS "," ; + +oper + -- Note: this results in a space before 's, but there's + -- not mauch we can do about that. + addGenitiveS : Str -> Case => Str = \s -> + table { Gen => s ++ "'s"; _ => s } ; +-} +}