Skip to content

Commit e867766

Browse files
author
Hämäläinen, Mika K
committed
Merge remote-tracking branch 'origin/master'
2 parents dc663f5 + bf0ff6f commit e867766

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,26 @@ Run
1515
pip install syntaxmaker
1616
python -m uralicNLP.download -l fin
1717

18-
After installing it, go to [Creating a sentence, the basics](https://github.com/mikahama/syntaxmaker/wiki/Creating-a-sentence,-the-basics) for a quick start guide.
18+
19+
# Usage
20+
21+
An example for generating a sentence in Finnish:
22+
23+
from syntaxmaker.syntax_maker import *
24+
vp = create_verb_pharse("antaa")
25+
subject = create_phrase("NP", "hevonen", {"NUM": "PL"})
26+
27+
dobject = create_phrase("NP", "lahja", {"NUM": "PL"})
28+
dobject.components["attribute"] = create_phrase("AP", "mahtava")
29+
dobject.components["attribute"].components["attribute"] = create_phrase("AdvP", "erittäin")
30+
31+
indobject = create_phrase("NP", "lehmä")
32+
vp.components["subject"] = subject
33+
vp.components["dir_object"] = dobject
34+
vp.components["indir_object"] = indobject
35+
>> hevoset antavat erittäin mahtavia lahjoja lehmälle
36+
37+
Go to [Creating a sentence, the basics](https://github.com/mikahama/syntaxmaker/wiki/Creating-a-sentence,-the-basics) for a quick start guide.
1938

2039
A good source of example code with the expected output can be found in [the Travis test file](https://github.com/mikahama/syntaxmaker/blob/master/travis_test.py).
2140

0 commit comments

Comments
 (0)