forked from GitHub/comp-syntax-gu-mlt
change minitranslator to use MicroLang
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
|
microlang:
|
||||||
|
gf -make ../lab2/grammar/english/MicroLangEng.gf ../lab2/grammar/functor/MicroLangFunctorSwe.gf
|
||||||
|
|
||||||
minilang:
|
minilang:
|
||||||
gf -make ../lab2/grammar/english/MiniLangEng.gf ../lab2/grammar/swedish/MiniLangSwe.gf
|
gf -make ../lab2/grammar/english/MiniLangEng.gf ../lab2/grammar/functor/MiniLangFunctorSwe.gf
|
||||||
|
|
||||||
query:
|
query:
|
||||||
gf -make QueryEng.gf QuerySwe.gf
|
gf -make QueryEng.gf QuerySwe.gf
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ A minimal translator can be found in
|
|||||||
|
|
||||||
[`minitranslator.py`](./minitranslator.py)
|
[`minitranslator.py`](./minitranslator.py)
|
||||||
|
|
||||||
This program reads one line of input and translates it from English to Swedish by using `MiniGrammar.pgf`. Example:
|
This program reads one line of input and translates it from English to Swedish by using `MicroGrammar.pgf`. Example:
|
||||||
```
|
```
|
||||||
$ echo "the cat is black" | python3 minitranslator.py
|
$ echo "the cat is black" | python3 minitranslator.py
|
||||||
katten är svart
|
katten är svart
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
import pgf
|
import pgf
|
||||||
|
|
||||||
# change these three to translate with other grammars and languages
|
# change these three to translate with other grammars and languages
|
||||||
absmodule = "MiniLang"
|
absmodule = "MicroLang"
|
||||||
fromname = absmodule + "Eng"
|
fromname = absmodule + "Eng"
|
||||||
toname = absmodule + "Swe"
|
toname = absmodule + "FunctorSwe"
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# read in the grammar, set up to and from languages
|
# read in the grammar, set up to and from languages
|
||||||
|
|||||||
Reference in New Issue
Block a user