This module provides aliases to call the main NSM-DALIA predicates, (contained in modules nsmdalia.pl and file_reader.pl), and the running interface.
nsmfiles.txt
for
details).
Used in automatic translation. Once current_lang and current_l2 are set, the "translation" commands translate NSM sentences from current_lang into current_l2. Lang = language code.
Useful to switch between various languages when you have loaded more than one grammar. The "Lang" argument is a language code.
MarkUp is a term referring to one of the supported markup
schemes (see NSM-files.txt
and grammars.txt
).
line_by_line
or whole_text
. The NSM-file parser has
an option for translating an NSM text and displaying the translation together
with the original.
Note that, for example, the rtf markup scheme requires a
line_by_line
option which, however, result in the texts being
displayed in a two_column table, one column for the original, the other for
the translation, and with corresponding lines aligned.
You won't need this very much, because "ps" can parse single words, as well as whole sentences. When you are developing a grammar, however, this command can be useful, because it also outputs a morpheme split-up of the word. The argument W is a double-quoted string, which is analyzed as a word of the last current language set. Ex.
DALIA> pw("things").
NSM-DALIA answers:
Morphemic String: thing-s ct(n(n), sp(e, e, plur(e), [], something(thing))).
DALIA> ps("something good is happening now").
NSM-DALIA answers with the corresponding NSM-PROLOG formula:
ct(s, s(e, time(e, now, e), e, e, e, p(i(happen), [o:sp(e, e, sing(e),[good], something(thing)), d:e]), e, e)).
Prints only the "minimal" table.
DALIA> ps("I do something good")
NSM-DALIA answers with the corresponding NSM-PROLOG formula:
s: _____ . pred: _____ . . v:do . . a: _____ . . . pers:loc(me) . . . n:me . . o: _____ . . . a: _____ . . . . eval: _____ . . . . . a:good . . . n:something(thing)
Prints only the full table.
DALIA> ps("I do something good")
NSM-DALIA answers with the corresponding NSM-PROLOG formula:
s: _____ . c: _____ . . compl:e . . top:e . . int:e . . top2:e . . foc:e . . pol:e . mod: _____ . . speech_act:e . . eval:e . . evid:e . . epist:e . f: _____ . . top3:e . . finite:e . t: _____ . . past:e . . fut:e . m: _____ . . irrealis:e . . necess:e . . possib:e . . vol:e . . oblig:e . . allow:e . asp: _____ . . hab:e . . rep:e . . freq:e . . celer:e . . ant:e . . term:e . . cont:e . . perf:e . . retro:e . . pross:e . . dur:e . . prog:e . . prosp:e . . compl_sg:e . . compl_pl:e . vo: _____ . . v_1:e . . v_2:e . . v_3:e . ak: _____ . . celer:e . . comp:e . . rep:e . . freq:e . pred: _____ . . v:do . . a: _____ . . . det:e . . . alt:e . . . q:e . . . pers:loc(me) . . . a: _____ . . . . eval:e . . . . size:e . . . . length:e . . . . height:e . . . . speed:e . . . . width:e . . . . weight:e . . . . temp: . . . . age:e . . . . shape:e . . . . colour:e . . . . origin:e . . . . material:e . . . dem:e . . . poss:e . . . class:e . . . n:me . . o: _____ . . . det:e . . . alt:e . . . q:e . . . pers:e . . . a: _____ . . . . eval: _____ . . . . . int:e . . . . . a:good . . . . size:e . . . . length:e . . . . height:e . . . . speed:e . . . . width:e . . . . weight:e . . . . temp:e . . . . age:e . . . . shape:e . . . . colour:e . . . . origin:e . . . . material:e . . . dem:e . . . poss:e . . . class:e . . . n:something(thing) . . d:e . . e:e . . c:e . . i:e . . b:e . . l:e . . m:e
DALIA> gs(ct(s, s(e, before(now), e, e, e, p(do, [a:sp(e, e, sing(e), [], me), o:sp(e, e, sing(e), [good], something(thing)), d:e, c:e, i:e]), e, e))).
Answer:
I did something good
DALIA> so("pippo.txt"). * Output file set to pippo.txt
You will perhaps use this mostly before a "pf" command.
Users will rarely use this command, because the output file is automatically closed (and the output redirected again to the console) when the parsing of an NSM-input file is finished.
files.txt
"). You can write a whole file of NSM texts in,
say, English NSM, and then have it parsed or translated automatically. This
will probably be one of the most used commands, when other language modules
are available.
tm(1).
To switch it off, say
tm(0)
Verbose modes are useful in grammar development. Turning tracing morphology on, the "parse" and "generate" commands will display information about the grammar rules used during the parsing process, in the morphophonemic component of the grammar. This will help you to find out why the morphophonemic component of your grammar is not doing what you intended it to do.
Saves a formatted version of the lexical database (stored with m/4 predicates), in the current active markup format.
The following predicates are exported, but not or incorrectly documented.