Grammar Specs

From UNL Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: UNL-NL grammars are sets of rules for translating UNL expressions into natural language (NL) sentences and NL sentences into UNL expressions. They are normally unidirectional, i.e., the en...)
 
(Redirected page to Grammar)
 
(344 intermediate revisions by 2 users not shown)
Line 1: Line 1:
UNL-NL grammars are sets of rules for translating UNL expressions into natural language (NL) sentences and NL sentences into UNL expressions. They are normally unidirectional, i.e., the enconversion grammar (NL-to-UNL) is different from the deconversion grammar (UNL-to-NL), even though they share the same basic syntax. In order to standardize the language resources in the UNL framework, the UNDL Foundation recommends the adoption of the following specifications for both UNL-to-NL and NL-to-UNL grammars. This formalism, however, is not supported by the UNL Centre's tools, and it is only required by those interested in using UNDL Foundation's tools.
+
#REDIRECT [[Grammar]]
 
+
== Types of rules ==
+
 
+
In the UNL Grammar there are two basic types of rules:
+
 
+
;Transformation rules
+
:Used to generate natural language sentences out of UNL graphs and vice-versa.
+
;Disambiguation rules
+
:Used to improve the performance of transformation rules by constraining their applicability.
+
 
+
The Transformation Rules follow the very general formalism
+
 
+
α:=β;
+
 
+
where the left side α is a condition statement, and the right side β is an action to be performed over α.
+
 
+
The Disambiguation Rules, which were directly inspired by the UNL Centre's former co-occurrence dictionary and knowledge base, follows a slightly different formalism:
+
 
+
α=P;
+
 
+
where the left side α is a statement and the right side P is an integer from 0 to 255 that indicates the probability of occurrence of α. 
+
 
+
We present both types of rules and their role in the UNL System. We introduce, first, the basic symbols that are used both by transformation and disambiguation rules; next, we present the transformation rules and their several subtypes; and finally we present the disambiguation rules.
+
 
+
== Basic symbols ==
+
 
+
Both transformation and disambiguation rules use the same set of basic symbols:
+
 
+
<div align="center">
+
{| border="1" cellpadding="5"
+
|+
+
==== Basic symbols used in UNL grammar rules ====
+
!Symbol
+
!Definition
+
!Example
+
|-
+
|?
+
|any letter or digit
+
|?b = 1b, 2b, ab, bb
+
|-
+
|$
+
|any letter
+
|$b = ab, bb, cb, db
+
|-
+
|#
+
|any digit
+
|#b = 1b, 2b, 3b, 4b
+
|-
+
|*
+
|any sequence of letters or digits
+
|*b = 1b, 11b, 111b,
+
|-
+
|“ “
+
|string
+
|“buy” = “buy”
+
|-
+
|( , )
+
|complex expression
+
|
+
|-
+
|<nowiki>,</nowiki>
+
|and
+
|a,b = a and b
+
|-
+
|<nowiki>^</nowiki>
+
|not
+
|^a = not a
+
|-
+
|( )
+
|optional
+
|a(b)c = ac or abc
+
|-
+
|{ }
+
|or
+
|{a,b} = a or b
+
|-
+
|*
+
|To be repeated more than 0 times
+
|a* = a, aa, aaa, …
+
|-
+
|&
+
|and + blank space
+
|a&b = a b
+
|-
+
|<nowiki>+</nowiki>
+
|add
+
|<nowiki>+</nowiki>a = add a
+
|-
+
|<nowiki>-</nowiki>
+
|remove
+
|<nowiki>-</nowiki>a = remove a
+
|-
+
|%##
+
|placeholder for nodes
+
|%01
+
|-
+
|&##
+
|placeholder for attributes
+
|&01
+
|-
+
|#
+
|placeholder for NLWs
+
|#01
+
|-
+
|}
+
</div>
+

Latest revision as of 19:11, 19 August 2013

  1. REDIRECT Grammar
Software