UNL-NL Dictionaries

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
Line 15: Line 15:
 
::*a simple word: [happiness]
 
::*a simple word: [happiness]
 
::*a simple morpheme: [happ]
 
::*a simple morpheme: [happ]
::*a complex structure*: [[bring] [back]]
+
::*a complex structure (see below): [[bring] [back]]
 
::*a non-motivated linguistic entity: [g]
 
::*a non-motivated linguistic entity: [g]
<nowiki>*</nowiki> complex structures are used for infixation, as in “Bring him back”
 
  
 
;ID
 
;ID
Line 43: Line 42:
 
;COMMENT
 
;COMMENT
 
:Any comment necessary to clarify the mapping between NL and UNL entries. It should end with the return code.
 
:Any comment necessary to clarify the mapping between NL and UNL entries. It should end with the return code.
 +
 +
== Complex structures as NLW =
 +
 +
In order to deal with '''infixation''', the NLW can be represented as a complex structure made of more basic NLW entries as indicated below:
 +
 +
[[bring] [back]] {} "to bring back(icl>to bring)" (pos=VER, 01#(pos=VER, past:=4>ought), 02#(pos:PRE)) < en, 0, 0>;
 +
 +
In the entry above, the NLW has been split into two different NLWs (01 and 02), which have different features, referred to in the embedded parentheses inside the feature list. The numbers 01 and 02 refer to first and to second embedded NLW respectively.
 +
  
 
== Transformation rules for dictionary entries ==  
 
== Transformation rules for dictionary entries ==  
  
In order to deal with exceptions, infixation and irregular forms, the following rules can be included inside dictionary entries (in the feature list field):
+
In order to deal with exceptions and irregular forms, the following rules can be included inside dictionary entries (in the feature list field):
  
 
;Replacement:
 
;Replacement:
 
:<ATTRIBUTE>”:=”<SOURCE>”:”<TARGET>
 
:<ATTRIBUTE>”:=”<SOURCE>”:”<TARGET>
::plural:="oo":"ee" (it means that, in case of the feature "plural", the "oo" string will be replaced by "ee" in the NLW, as in foot>feet)
+
::Example: plural:="oo":"ee" (it means that, in case of the feature "plural", the "oo" string will be replaced by "ee" in the NLW, as in foot>feet)
  
 
;Left appending:
 
;Left appending:
 
:<ATTRIBUTE>”:=”<LEFT DELETION>”<”<LEFT ADDITION>
 
:<ATTRIBUTE>”:=”<LEFT DELETION>”<”<LEFT ADDITION>
::not:=<"un" (it means that, in case of the feature "not", the string "un" will be added to the left of the NLW, as in dress>undress)
+
::Example: not:=<"un" (it means that, in case of the feature "not", the string "un" will be added to the left of the NLW, as in dress>undress)
  
 
;Right appending:
 
;Right appending:
 
:<ATTRIBUTE>”:=”<RIGHT ADDITION>”>”<RIGHT DELETION>
 
:<ATTRIBUTE>”:=”<RIGHT ADDITION>”>”<RIGHT DELETION>
::plural:=y>ies (it means that, in case of the feature "plural", the rightmost "y" will be deleted and the "ies" string will be added to the right of the NLW, as in baby>babies)
+
::Example: plural:=y>ies (it means that, in case of the feature "plural", the rightmost "y" will be deleted and the "ies" string will be added to the right of the NLW, as in baby>babies)
  
 
Where:<br >
 
Where:<br >
Line 68: Line 76:
 
<LEFT ADDITION> is the string to be added to beginning of the NLW<br >
 
<LEFT ADDITION> is the string to be added to beginning of the NLW<br >
 
<RIGHT ADDITION> is the string to be added to the end of the NLW<br >
 
<RIGHT ADDITION> is the string to be added to the end of the NLW<br >
 +
 +
== Examples of dictionary entries ==
 +
 +
[a]{}  ""  (pos=DFA) <EN,0,0>;<br>
 +
[book]{} "book(icl>thing)"  (pos=N) <EN,0,0>;<br>
 +
[buy]{} "buy(icl>do)" (pos=DTV, PP=04) <EN,0,0>;<br>
 +
[book] {} “book(icl>document)” (pos=NOU) <EN,0,0>;<br>
 +
[foot] {} “foot(icl>vertebrate foot) (pos=NOU, pl:=”feet”) <EN,0,0>;<br>
 +
[baby] {} “baby(icl>child) (pos=NOU, pl:=”y”>”ies”) <EN,0,0>;<br>
 +
[baby] {} “baby(icl>child) (pos=NOU, pl:=1>”ies”) <EN,0,0>;<br>

Revision as of 21:23, 16 April 2009

The UNL-NL dictionaries are bilingual dictionaries linking UWs to natural language (NL) words. They can be unidirectional (UNL-to-NL or NL-to-UNL) or bidirectional (NL-to-UNL-to-NL). UNL-to-NL dictionaries are used for deconversion, while NL-to-UNL are used for enconversion.

Contents

Syntax

In the UNL System, the UNL-NL dictionaries are plain text files with a single entry per line in the following format:

[NLW]  {ID}  “UW”  (ATTR , ... )  < LG , FRE , PRI >; COMMENTS

Where:

NLW
The lexical item of the natural language. Its format should be decided by the dictionary builder. It can be:
  • a multiword expression: [United States of America]
  • a compound: [hot-dog]
  • a simple word: [happiness]
  • a simple morpheme: [happ]
  • a complex structure (see below): [[bring] [back]]
  • a non-motivated linguistic entity: [g]
ID
The unique identifier (primary-key) of the entry.
UW
The Universal Word of UNL. This field can be empty if a word does not need a UW.
ATTR
The list of features of the NLW. It can be:
  • a list of simple features: (NOU, MCL, SNG)
  • a list of attribute-value pairs: (pos=NOU, gen=MCL, num=SNG)
  • a list of attribute and transformation rules (see below): (plural:=”oo”:”ee”)

Attributes should be separated by “,”.

FLG
The two-character language code according to ISO 639-1.
FRE
The frequency of NLW in natural texts. Used for natural language analysis (NL-UNL). It can range from 0 (less frequent) to 255 (most frequent).
PRI
The priority of the NLW. Used for natural language generation (UNL-NL). It can range from 0 to 255.
COMMENT
Any comment necessary to clarify the mapping between NL and UNL entries. It should end with the return code.

= Complex structures as NLW

In order to deal with infixation, the NLW can be represented as a complex structure made of more basic NLW entries as indicated below:

[[bring] [back]] {} "to bring back(icl>to bring)" (pos=VER, 01#(pos=VER, past:=4>ought), 02#(pos:PRE)) < en, 0, 0>;

In the entry above, the NLW has been split into two different NLWs (01 and 02), which have different features, referred to in the embedded parentheses inside the feature list. The numbers 01 and 02 refer to first and to second embedded NLW respectively.


Transformation rules for dictionary entries

In order to deal with exceptions and irregular forms, the following rules can be included inside dictionary entries (in the feature list field):

Replacement
<ATTRIBUTE>”:=”<SOURCE>”:”<TARGET>
Example: plural:="oo":"ee" (it means that, in case of the feature "plural", the "oo" string will be replaced by "ee" in the NLW, as in foot>feet)
Left appending
<ATTRIBUTE>”:=”<LEFT DELETION>”<”<LEFT ADDITION>
Example: not:=<"un" (it means that, in case of the feature "not", the string "un" will be added to the left of the NLW, as in dress>undress)
Right appending
<ATTRIBUTE>”:=”<RIGHT ADDITION>”>”<RIGHT DELETION>
Example: plural:=y>ies (it means that, in case of the feature "plural", the rightmost "y" will be deleted and the "ies" string will be added to the right of the NLW, as in baby>babies)

Where:
<ATTRIBUTE> is the name of the attribute
<SOURCE> is the original form to be replaced (if empty, it means that the whole NLW should be replaced)
<TARGET> is the form to be used instead of the source (if empty, it means that the whole NLW should be deleted)
<LEFT DELETION> is the string or the number of characters from the beginning of the NLW to be deleted before the addition of the LEFT ADDITION
<RIGHT DELETION> is the string or the number of characters from the end of the NLW to be deleted before the addition of the RIGHT ADDITION
<LEFT ADDITION> is the string to be added to beginning of the NLW
<RIGHT ADDITION> is the string to be added to the end of the NLW

Examples of dictionary entries

[a]{} "" (pos=DFA) <EN,0,0>;
[book]{} "book(icl>thing)" (pos=N) <EN,0,0>;
[buy]{} "buy(icl>do)" (pos=DTV, PP=04) <EN,0,0>;
[book] {} “book(icl>document)” (pos=NOU) <EN,0,0>;
[foot] {} “foot(icl>vertebrate foot) (pos=NOU, pl:=”feet”) <EN,0,0>;
[baby] {} “baby(icl>child) (pos=NOU, pl:=”y”>”ies”) <EN,0,0>;
[baby] {} “baby(icl>child) (pos=NOU, pl:=1>”ies”) <EN,0,0>;

Software