politeness and disambiguation in Phrasebook (not visible yet)

This commit is contained in:
aarne
2010-03-24 08:18:54 +00:00
parent 68482aa7e9
commit 3ff870dcd6
8 changed files with 115 additions and 38 deletions

View 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
} ;
}