mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-08 10:42:50 -06:00
politeness and disambiguation in Phrasebook (not visible yet)
This commit is contained in:
34
examples/phrasebook/Roles.gf
Normal file
34
examples/phrasebook/Roles.gf
Normal file
@@ -0,0 +1,34 @@
|
||||
resource Roles = {
|
||||
|
||||
param
|
||||
Gender = Male | Female ;
|
||||
Politeness = Polite | Familiar ;
|
||||
|
||||
oper
|
||||
RolePhrase : Type = {s : Politeness => Gender => Gender => Str} ;
|
||||
|
||||
politeDistinct : (_,_ : Str) -> RolePhrase = \pol,fam -> {
|
||||
s = table {
|
||||
Polite => \\_,_ => pol ;
|
||||
Familiar => \\_,_ => fam
|
||||
}
|
||||
} ;
|
||||
|
||||
speakerDistinct : (_,_ : Str) -> RolePhrase = \mal,fem -> {
|
||||
s = \\p,s,h => case s of {
|
||||
Male => mal ;
|
||||
Female => fem
|
||||
}
|
||||
} ;
|
||||
|
||||
hearerDistinct : (_,_ : Str) -> RolePhrase = \mal,fem -> {
|
||||
s = \\p,s,h => case h of {
|
||||
Male => mal ;
|
||||
Female => fem
|
||||
}
|
||||
} ;
|
||||
|
||||
roleNeutral : Str -> RolePhrase = \s -> {
|
||||
s = \\_,_,_ => s
|
||||
} ;
|
||||
}
|
||||
Reference in New Issue
Block a user