|  |   | 
| (37 intermediate revisions by one other user not shown) | 
| Line 1: | Line 1: | 
|  | In order to form a natural language sentence or a UNL graph, nodes are inter-related by relations. In the UNL framework, there can be three different types of relations:
 |  | The relation "and" or "or" between the strings "a" and "b" (use regular expressions) | 
|  | *the '''linear''' relation L expresses the surface structure of natural language sentences
 |  | does it work? /.{2,3}/("a";"b") | 
|  | *'''syntactic''' relations express the deep (tree) structure of natural language sentences
 |  | 
|  | *'''semantic''' relations express the structure of UNL graphs
 |  | 
|  | ===== Properties of relations =====
 |  | 
|  | ;Thelinear relationis always binary and is represented in two possible formats:
 |  | 
|  | *L(%x;%y), where L is the invariant name of the linear relation, and %x and %y are nodes; or
 |  | 
|  | *(%x)(%y)
 |  | 
|  | ;Syntactic relations are not predefined, although we have been using a set of binary relations based on the [[X-bar theory]].
 |  | 
|  | ;Semantic relations constitute a predefined and closed set that can be found [[relations|here]].
 |  | 
|  | ;Syntactic and semantic relations are represented in the same way:
 |  | 
|  | *rel(%x;%y), where "rel" is the name of the relation, %x is the source node, and %y is the target node
 |  | 
|  | ;Arguments of linear, syntactic andsemantic relations are not commutative.
 |  | 
|  | :The order of the elements in a relation affects the result:
 |  | 
|  | ::(%x)(%y) is different from (%y)(%x)
 |  | 
|  | ::relation(%x;%y) is different from relation(%y;%x)
 |  | 
|  | ;Linear and semantic relations are always binary; syntactic relations may be n-ary:
 |  | 
|  | :L(%x;%y) - linear relation
 |  | 
|  | :agt(%x;%y) - semantic relation
 |  | 
|  | :VH(%x) - unary syntactic relation
 |  | 
|  | :VC(%x;%y) - binary syntactic relation
 |  | 
|  | :XX(%x;%y;%z) - possible ternary syntactic relation
 |  | 
|  | ;Inside each relation, nodes are isolated by semicolon (;). 
 |  | 
|  | :VC(%x;%y)
 |  | 
|  | :<strike>VC(%x,%y)</strike>
 |  | 
|  | ;Inside each relation, nodes may be referenced by any of its elements, isolated by comma (,):
 |  | 
|  | :("a")([b]) - linear relation between a node where string = "a" and another node where headword = [b]
 |  | 
|  | :L(<nowiki>[[c]]</nowiki>;D) - linear relation between a node where UW = <nowiki>[[c]]</nowiki> and another node having the feature D
 |  | 
|  | :VC(%a;%b) - syntactic relation between a node where index = %a and another node where index = %b
 |  | 
|  | :agt("a",[a],<nowiki>[[a]]</nowiki>,A;"b",[b],<nowiki>[[b]]</nowiki>,B) - semantic relation betweena node having thefeature A where string = "a" AND headword "a"AND UW = <nowiki>[[a]]</nowiki> AND another node having the feature B where string = "b" AND headword = [b] AND UW = <nowiki>[[b]]</nowiki>
 |  | 
|  | ;Relations may be conjoined through juxtaposition:
 |  | 
|  | :("a")("b")("c") - two linear relations: one between ("a") and("b") AND other between ("b") and ("c")
 |  | 
|  | :agt(%x;%y)obj(%x;%z) - two semantic relations: one between (%x) and (%y) AND other between (%x) and (%z)
 |  | 
|  | :<strike>VC([a];[b]),VC([a];[c])</strike> - conjoined relations must not be isolated by comma
 |  | 
|  | ;Relations may be disjoined through {braces}
 |  | 
|  | :{("a")|("b")}("c") - either ("a")("c") or ("b")("c")
 |  | 
|  | :{agt(%x;%y)|exp(%x;%y)}obj(%x;%z) - either agt(%x;%y)obj(%x;%z) or exp(%x;%y)obj(%x;%z)
 |  | 
|  | ;Syntactic and semantic relations may be replaced by regular expressions
 |  | 
|  | :/.{2,3}/(%x;%y)- any relation made of two or three characters between %x and %y
 |  | 
The relation "and" or "or" between the strings "a" and "b" (use regular expressions)
does it work? /.{2,3}/("a";"b")