UiT > Divvun
 
Font size:      

How to use the morphological parsers

Preamble: setting up the environment (You probably did this already)

  1. Machine setup: Getting started.
  2. Download the source files: How to use SVN. Remember to write svnup and press the return key (from now on indicated by <ENTER>) whenever you start working.
  3. Making the transducers (compilation): Getting Started With The New Infra. (Or, if you work on North Saami, write instead cd main/gt <ENTER>, and make GTLANG=sme.)

Analysing and generating words

  1. For analysis, write u and then the 3-letter language code, e.g. for North Sami, write usme
  2. Then write the words that shall be analysed, one word at a time, followed by <ENTER>.
  3. To leave analysis mode, press ctrl C.
  4. For generation, write d and then the 3-letter language code, e.g. for North Sami, write dsme
  5. Then write lemma and grammatical tags (in the same form as was given as output, followed by <ENTER>.

For testing, you may also write a file with one wordform on each line, and then feed that to the analyser (example here is for Inari Sámi, with a file testfile.txt):

cat testfile.txt | usmn | less

(again, to leave analysis mode, press ctrl C, and to leave less, press q)

Text analysis

We have set up aliases for text analysis. These may be written anywhere.

smedis
Gives a sentence analysis of North Sámi
smedep
Gives a dependency analysis of North Sámi
smedist
Gives a sentence analysis of North Sámi, in trace mode (showing which dis rules work)
smedept
Gives a dependency analysis of North Sámi, in trace mode (showing which dep rules work)

To do the same for other languages, exchange sme with your own language code. If, for any given language, the alias does not work, it means there is no (say) dependency analysis written for that language.

These aliases may be used in two ways: either write the alias followed by a sentence in quotes

smedis "Mun lean boahtán."

Or, alternatively, pipe a file through it:

cat testfile.txt | smedis

Output manipulation

Instead of just showing the result on the screen as running text (as above), much can be done to manipulate it. Here are some examples, all the textstrings should be added after the smedis etc. above.

| grep '+N+Pl' > plnouns
(to get all plural nouns and save them to the file plnouns)

| grep -v '\?' | cut -f2 | sort | uniq -c | sort -nr | less
(to get a frequency list of the lexemes that the parser recognizes.

| grep '\?' | sort | uniq -c | sort -nr | less
(to get a frequency list of the words that the parser does not recognize)

| grep '\+\?' | sort | uniq -c | sort -nr | less
(to get a frequency list of the word forms that the parser does not recognize)

To analyse more files at the same time, write their names one after another after the cat command:

cat file1 file2 file3 |  ...

Last modified $Date$, by $Author: lene $

by Trond Trosterud