From aedaee8312f5d18047710b1b509d3bef2d7f6849 Mon Sep 17 00:00:00 2001 From: aarneranta Date: Wed, 26 May 2021 08:50:08 +0200 Subject: [PATCH] change minitranslator to use MicroLang --- python/Makefile | 5 ++++- python/README.md | 2 +- python/minitranslator.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python/Makefile b/python/Makefile index 202ea33..ba524c2 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,5 +1,8 @@ +microlang: + gf -make ../lab2/grammar/english/MicroLangEng.gf ../lab2/grammar/functor/MicroLangFunctorSwe.gf + 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: gf -make QueryEng.gf QuerySwe.gf diff --git a/python/README.md b/python/README.md index 8b87f9d..1680689 100644 --- a/python/README.md +++ b/python/README.md @@ -30,7 +30,7 @@ A minimal translator can be found in [`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 katten är svart diff --git a/python/minitranslator.py b/python/minitranslator.py index efb4d76..4771da9 100644 --- a/python/minitranslator.py +++ b/python/minitranslator.py @@ -4,9 +4,9 @@ import pgf # change these three to translate with other grammars and languages -absmodule = "MiniLang" +absmodule = "MicroLang" fromname = absmodule + "Eng" -toname = absmodule + "Swe" +toname = absmodule + "FunctorSwe" def main(): # read in the grammar, set up to and from languages