From a47083156023dbda3f0c606e0626973c75d359dc Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 14 Dec 2005 16:28:57 +0000 Subject: [PATCH] mp3 example --- examples/mp3/Lexicon.gf | 6 ++++++ examples/mp3/LexiconEng.gf | 9 ++++++++ examples/mp3/LexiconFin.gf | 9 ++++++++ examples/mp3/LexiconFre.gf | 9 ++++++++ examples/mp3/LexiconGer.gf | 8 +++++++ examples/mp3/LexiconSwe.gf | 9 ++++++++ examples/mp3/MP3.gf | 19 ++++++++++++++++ examples/mp3/MP3Eng.gf | 5 +++++ examples/mp3/MP3Fin.gf | 5 +++++ examples/mp3/MP3Fre.gf | 5 +++++ examples/mp3/MP3Ger.gf | 5 +++++ examples/mp3/MP3I.gf | 24 +++++++++++++++++++++ examples/mp3/MP3Swe.gf | 5 +++++ lib/resource-0.6/english/SyntaxEng.gf | 4 ++-- lib/resource-0.6/english/TestResourceEng.gf | 2 +- lib/resource-0.6/german/MorphoGer.gf | 2 +- lib/resource-0.6/german/SyntaxGer.gf | 2 +- lib/resource-0.6/german/TestResourceGer.gf | 2 +- src/GF/System/ATKSpeechInput.hs | 4 ++-- 19 files changed, 126 insertions(+), 8 deletions(-) create mode 100644 examples/mp3/Lexicon.gf create mode 100644 examples/mp3/LexiconEng.gf create mode 100644 examples/mp3/LexiconFin.gf create mode 100644 examples/mp3/LexiconFre.gf create mode 100644 examples/mp3/LexiconGer.gf create mode 100644 examples/mp3/LexiconSwe.gf create mode 100644 examples/mp3/MP3.gf create mode 100644 examples/mp3/MP3Eng.gf create mode 100644 examples/mp3/MP3Fin.gf create mode 100644 examples/mp3/MP3Fre.gf create mode 100644 examples/mp3/MP3Ger.gf create mode 100644 examples/mp3/MP3I.gf create mode 100644 examples/mp3/MP3Swe.gf diff --git a/examples/mp3/Lexicon.gf b/examples/mp3/Lexicon.gf new file mode 100644 index 000000000..8d3bccaf9 --- /dev/null +++ b/examples/mp3/Lexicon.gf @@ -0,0 +1,6 @@ +interface Lexicon = open Structural in { + + oper + play : TV ; + song : N ; +} diff --git a/examples/mp3/LexiconEng.gf b/examples/mp3/LexiconEng.gf new file mode 100644 index 000000000..5b5861397 --- /dev/null +++ b/examples/mp3/LexiconEng.gf @@ -0,0 +1,9 @@ +instance LexiconEng of Lexicon = open StructuralEng, ParadigmsEng in { + + oper + play = tvDir (vReg "play") ; + song = nReg "song" nonhuman ; + + yesterday = npReg "Yesterday" ; + +} \ No newline at end of file diff --git a/examples/mp3/LexiconFin.gf b/examples/mp3/LexiconFin.gf new file mode 100644 index 000000000..757535bbf --- /dev/null +++ b/examples/mp3/LexiconFin.gf @@ -0,0 +1,9 @@ +instance LexiconFin of Lexicon = open StructuralFin, ParadigmsFin in { + + oper + play = tvDir (vKattaa "soittaa" "soitan") ; + song = nRae "kappale" "kappaleena" ; + + yesterday = UsePN (mkPN (nPuu "Yesterday")) ; + +} \ No newline at end of file diff --git a/examples/mp3/LexiconFre.gf b/examples/mp3/LexiconFre.gf new file mode 100644 index 000000000..33188ca1b --- /dev/null +++ b/examples/mp3/LexiconFre.gf @@ -0,0 +1,9 @@ +instance LexiconFre of Lexicon = open StructuralFre, ParadigmsFre in { + + oper + play = tvDir (vAimer "jouer") ; + song = nReg "chanson" feminine ; + + yesterday = mkNP "Yesterday" masculine ; + +} \ No newline at end of file diff --git a/examples/mp3/LexiconGer.gf b/examples/mp3/LexiconGer.gf new file mode 100644 index 000000000..729a64ac8 --- /dev/null +++ b/examples/mp3/LexiconGer.gf @@ -0,0 +1,8 @@ +instance LexiconGer of Lexicon = open StructuralGer, ParadigmsGer in { + + oper + play = tvDir (vWeak "spielen") ; + song = nBuch "lied" "lieder" ; + + yesterday = npReg "Yesterday" ; +} \ No newline at end of file diff --git a/examples/mp3/LexiconSwe.gf b/examples/mp3/LexiconSwe.gf new file mode 100644 index 000000000..f4b17080f --- /dev/null +++ b/examples/mp3/LexiconSwe.gf @@ -0,0 +1,9 @@ +instance LexiconSwe of Lexicon = open StructuralSwe, ParadigmsSwe in { + + oper + play = tvDir (vKoka "spela") ; + song = nBil "låt" ; + + yesterday = npReg "Yesterday" neutrum ; + +} \ No newline at end of file diff --git a/examples/mp3/MP3.gf b/examples/mp3/MP3.gf new file mode 100644 index 000000000..cc4dd882a --- /dev/null +++ b/examples/mp3/MP3.gf @@ -0,0 +1,19 @@ +abstract MP3 = { + cat + Move ; + Song ; + + fun + Play : Song -> Move ; + CanPlay : Song -> Move ; + WantPlay : Song -> Move ; + WhichPlay : Move ; + + ThisSong : Song ; + This : Song ; + + Yesterday : Song ; + +---- MkSong : String -> Song ; + +} diff --git a/examples/mp3/MP3Eng.gf b/examples/mp3/MP3Eng.gf new file mode 100644 index 000000000..7648c1117 --- /dev/null +++ b/examples/mp3/MP3Eng.gf @@ -0,0 +1,5 @@ +--# -path=.:resource-0.6/english:resource-0.6/abstract:prelude + +concrete MP3Eng of MP3 = MP3I with + (Structural = StructuralEng), + (Lexicon = LexiconEng) ; diff --git a/examples/mp3/MP3Fin.gf b/examples/mp3/MP3Fin.gf new file mode 100644 index 000000000..099917c18 --- /dev/null +++ b/examples/mp3/MP3Fin.gf @@ -0,0 +1,5 @@ +--# -path=.:resource-0.6/finnish:resource-0.6/abstract:prelude + +concrete MP3Fin of MP3 = MP3I with + (Structural = StructuralFin), + (Lexicon = LexiconFin) ; diff --git a/examples/mp3/MP3Fre.gf b/examples/mp3/MP3Fre.gf new file mode 100644 index 000000000..2fcd6b8f2 --- /dev/null +++ b/examples/mp3/MP3Fre.gf @@ -0,0 +1,5 @@ +--# -path=.:resource-0.6/french:resource-0.6/romance:resource-0.6/abstract:prelude + +concrete MP3Fre of MP3 = MP3I with + (Structural = StructuralFre), + (Lexicon = LexiconFre) ; diff --git a/examples/mp3/MP3Ger.gf b/examples/mp3/MP3Ger.gf new file mode 100644 index 000000000..5dfdfe19c --- /dev/null +++ b/examples/mp3/MP3Ger.gf @@ -0,0 +1,5 @@ +--# -path=.:resource-0.6/german:resource-0.6/abstract:prelude + +concrete MP3Ger of MP3 = MP3I with + (Structural = StructuralGer), + (Lexicon = LexiconGer) ; diff --git a/examples/mp3/MP3I.gf b/examples/mp3/MP3I.gf new file mode 100644 index 000000000..ab8eb7915 --- /dev/null +++ b/examples/mp3/MP3I.gf @@ -0,0 +1,24 @@ +--# -path=.:resource-0.6/english:resource-0.6/abstract:prelude + +incomplete concrete MP3I of MP3 = open Structural, Lexicon in { + + flags startcat=Move ; + + lincat + Move = Phr ; + Song = NP ; + + lin + Play song = ImperOne (ImperVP (PosVG (PredTV play song))) ; + CanPlay song = QuestPhrase (QuestVP ThouNP (PosVG (PredVV CanVV (PredTV play song)))) ; + WantPlay song = IndicPhrase (PredVP INP (PosVG (PredVV WantVV (PredTV play song)))) ; + WhichPlay = QuestPhrase (IntVP (NounIPOne (UseN song)) (PosVG (PredPassV (VTrans play)))) ; + + ThisSong = DetNP ThisDet (UseN song) ; + This = ThisNP ; + + Yesterday = yesterday ; + +---- MkSong : String -> Song ; + +} diff --git a/examples/mp3/MP3Swe.gf b/examples/mp3/MP3Swe.gf new file mode 100644 index 000000000..54e20171f --- /dev/null +++ b/examples/mp3/MP3Swe.gf @@ -0,0 +1,5 @@ +--# -path=.:resource-0.6/swedish:resource-0.6/abstract:prelude + +concrete MP3Swe of MP3 = MP3I with + (Structural = StructuralSwe), + (Lexicon = LexiconSwe) ; diff --git a/lib/resource-0.6/english/SyntaxEng.gf b/lib/resource-0.6/english/SyntaxEng.gf index 2c67bf265..38855c8a6 100644 --- a/lib/resource-0.6/english/SyntaxEng.gf +++ b/lib/resource-0.6/english/SyntaxEng.gf @@ -634,10 +634,10 @@ s ; s2 = [] ; isAux = False} ; (try.s ! InfImp ++ try.s1) ; -- ... try in {s = \\b,v => if_then_Str b - (try.s ! v ++ try.s1 ++ to ++ run.s ! True ! InfImp) + (try.s ! v ++ try.s1) (dont ! v) ; s2 = \\b,v => if_then_Str b - (run.s2 ! True ! v) + (to ++ run.s ! True ! InfImp ++ run.s2 ! True ! v) (trnot ++ run.s ! True ! InfImp ++ run.s2 ! True ! v) ; isAuxT = taux ; isAuxF = True diff --git a/lib/resource-0.6/english/TestResourceEng.gf b/lib/resource-0.6/english/TestResourceEng.gf index 0a18ebd5b..f1e2c719e 100644 --- a/lib/resource-0.6/english/TestResourceEng.gf +++ b/lib/resource-0.6/english/TestResourceEng.gf @@ -2,7 +2,7 @@ concrete TestResourceEng of TestResource = StructuralEng ** open SyntaxEng, ParadigmsEng in { -flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ; +flags startcat=Phr ; lexer=textlit ; unlexer=text ; -- a random sample from the lexicon diff --git a/lib/resource-0.6/german/MorphoGer.gf b/lib/resource-0.6/german/MorphoGer.gf index b7e704882..178525760 100644 --- a/lib/resource-0.6/german/MorphoGer.gf +++ b/lib/resource-0.6/german/MorphoGer.gf @@ -492,7 +492,7 @@ oper -- Modal auxiliary verbs verbumAux : (_,_,_,_,_ : Str) -> Verbum = \können,kann,konnte,könnte,gekonnt -> - let k = (verbumStrongLaufen können kann konnte könnte gekonnt) + let k = mkVerbum können kann kann konnte könnte gekonnt ;--- (verbumStrongLaufen können kann konnte könnte gekonnt) in table { VInd Sg P1 => kann ; diff --git a/lib/resource-0.6/german/SyntaxGer.gf b/lib/resource-0.6/german/SyntaxGer.gf index 486447368..cdb8def0c 100644 --- a/lib/resource-0.6/german/SyntaxGer.gf +++ b/lib/resource-0.6/german/SyntaxGer.gf @@ -605,7 +605,7 @@ oper complVerbVerb : VerbVerb -> VerbGroup -> VerbGroup = \will, essen -> will ** { - s3 = \\b,_ => negation b ++ + s3 = \\b,n => essen.s3 ! True ! n ++ negation b ++ essen.s2 ++ zuInfinitive will.isAux ++ essen.s ! VInf ; s4 = essen.s4 } ; diff --git a/lib/resource-0.6/german/TestResourceGer.gf b/lib/resource-0.6/german/TestResourceGer.gf index 61e4abec2..aa24dc51d 100644 --- a/lib/resource-0.6/german/TestResourceGer.gf +++ b/lib/resource-0.6/german/TestResourceGer.gf @@ -3,7 +3,7 @@ concrete TestResourceGer of TestResource = StructuralGer ** open SyntaxGer in { -flags startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ; +flags startcat=Phr ; lexer=text ; unlexer=text ; -- a random sample from the lexicon diff --git a/src/GF/System/ATKSpeechInput.hs b/src/GF/System/ATKSpeechInput.hs index 8c0ed303e..a470fe9e7 100644 --- a/src/GF/System/ATKSpeechInput.hs +++ b/src/GF/System/ATKSpeechInput.hs @@ -28,9 +28,9 @@ import System.IO.Unsafe -- FIXME: get these from somewhere else -config = "/home/bjorn/projects/atkrec/atkrec.cfg" +config = "/home/aarne/atk/atkrec/atkrec.cfg" -res = "/home/bjorn/src/atk/Resources" +res = "/home/aarne/atk/atk/Resources" hmmlist = res ++ "/UK_SI_ZMFCC/hmmlistbg" mmf0 = res ++ "/UK_SI_ZMFCC/WI4" mmf1 = res ++ "/UK_SI_ZMFCC/BGHMM2"