mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-11 13:59:31 -06:00
started disambiguation example
This commit is contained in:
18
examples/disamb/Conversation.gf
Normal file
18
examples/disamb/Conversation.gf
Normal file
@@ -0,0 +1,18 @@
|
||||
abstract Conversation = {
|
||||
|
||||
cat
|
||||
Q ; NP ; A ;
|
||||
Gender ; Number ; Politeness ;
|
||||
|
||||
fun
|
||||
PredA : NP -> A -> Q ;
|
||||
|
||||
GMasc, GFem : Gender ;
|
||||
NSg, NPl : Number ;
|
||||
PFamiliar, PPolite : Politeness ;
|
||||
|
||||
You : Number -> Politeness -> Gender -> NP ;
|
||||
|
||||
Ready : A ;
|
||||
|
||||
}
|
||||
23
examples/disamb/ConversationEng.gf
Normal file
23
examples/disamb/ConversationEng.gf
Normal file
@@ -0,0 +1,23 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete ConversationEng of Conversation = open Prelude in {
|
||||
|
||||
lincat
|
||||
Q, NP, A = {s : Str} ;
|
||||
Gender, Number, Politeness = {s : Str} ;
|
||||
|
||||
lin
|
||||
PredA np a = ss ("are" ++ np.s ++ a.s) ;
|
||||
|
||||
GMasc = ss (optStr "man") ;
|
||||
GFem = ss (optStr "woman") ;
|
||||
NSg = ss (optStr "one") ;
|
||||
NPl = ss (optStr "many") ;
|
||||
PFamiliar = ss (optStr "friend") ;
|
||||
PPolite = ss (optStr "respected") ;
|
||||
|
||||
You n p g = ss ("you" ++ n.s ++ p.s ++ g.s) ;
|
||||
|
||||
Ready = ss "ready" ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user