Difference between revisions of "User:Firespeaker/Transfer rule example"

From Apertium
Jump to navigation Jump to search
(→‎Determiner Noun: attempts at color and formatting :()
 
(3 intermediate revisions by the same user not shown)
Line 9: Line 9:


=== Determiner Noun ===
=== Determiner Noun ===
<table class="wikitable" style="tab-size: 3;">
<table class="wikitable" style="tab-size: 2;">
<tr><th>rule</th><th></th><th></th></tr>
<tr><th>rule</th><th>property</th><th>information</th></tr>
<tr rowspan="2.5"><td><pre>
<tr><td rowspan="3">
<code>&lt;rule comment="REGLA: det noun"&gt;<br/>
&#9;&lt;pattern&gt;<br/>
&#9;&#9;&lt;pattern-item n="definites"/&gt;<br/>
&#9;&#9;&lt;pattern-item n="noun"/&gt;<br/>
&#9;&lt;/pattern&gt;<br/>
&#9;&lt;action&gt;<br/>
&#9;&#9;&lt;out&gt;<br/>
&#9;&#9;&#9;&lt;chunk name="n" case="caseFirstWord"&gt;<br/>
&#9;&#9;&#9;&#9;&lt;tags&gt;<br/>
&#9;&#9;&#9;&#9;&#9;&lt;tag&gt;&lt;lit-tag v="SN"/&gt;&lt;/tag&gt;<br/>
&#9;&#9;&#9;&#9;&#9;&lt;tag&gt;&lt;lit-tag v="def"/&gt;&lt;/tag&gt;<br/>
&#9;&#9;&#9;&#9;&#9;&lt;tag&gt;&lt;clip pos="2" side="tl" part="a_num"/&gt;&lt;/tag&gt;<br/>
&#9;&#9;&#9;&#9;&#9;&lt;tag&gt;&lt;lit-tag v="CD"/&gt;&lt;/tag&gt;<br/>
&nbsp;&#9;&#9;&#9;&#9;&lt;/tags&gt;<br/>
&nbsp;&#9;&#9;&#9;&#9;&lt;lu&gt;<br/>
&nbsp;&#9;&#9;&#9;&#9;&#9;&lt;clip pos="2" side="tl" part="lem"/&gt;<br/>
&emsp;&#9;&#9;&#9;&#9;&#9;&lt;clip pos="2" side="tl" part="a_pos"/&gt;<br/>
&#9;&#9;&#9;&#9;&#9;&lt;clip pos="2" side="tl" part="a_num"/&gt;<br/>
&#9;&#9;&#9;&#9;&#9;&lt;lit-tag v="4"/&gt;&lt;!-- case --&gt;<br/>
&#9;&#9;&#9;&#9;&lt;/lu&gt;<br/>
&#9;&#9;&#9;&lt;/chunk&gt;<br/>
&#9;&#9;&lt;/out&gt;<br/>
&#9;&lt;/action&gt;<br/>
&lt;/rule&gt;<br/></code>
<pre>
<rule comment="REGLA: det noun">
<rule comment="REGLA: det noun">
<pattern>
<pattern>
Line 28: Line 53:
<lu>
<lu>
<clip pos="2" side="tl" part="lem"/>
<clip pos="2" side="tl" part="lem"/>
<clip pos="2" side="tl" part="pos"/>
<clip pos="2" side="tl" part="<span span="color: red;">a_pos</span>"/>
<clip pos="2" side="tl" part="a_num"/>
<clip pos="2" side="tl" part="a_num"/>
<lit-tag v="4"/><!-- case -->
<lit-tag v="4"/><!-- case -->
Line 35: Line 60:
</out>
</out>
</action>
</action>
</rule></pre></td></tr>
</rule></pre></td>
<td>pattern matches:</td><td>I did not see <b>the houses</b>.</td></tr>
<tr><td>relevant categories:</td><td></td></tr>
<tr><td>relevant categories:</td><td></td></tr>
<tr><td>relevant attributes:</td><td><pre>
<tr><td>relevant attributes:</td><td><pre>
Line 43: Line 69:
<attr-item tags="ND"/>
<attr-item tags="ND"/>
</def-attr></pre></td></tr>
</def-attr></pre></td></tr>
<tr><td>pattern matches:</td><td>I did not see <b>the houses</b>.</td></tr>


</table>
</table>

Latest revision as of 15:04, 24 April 2019

Input text[edit]

  • "I did not see the houses."

Output of tagger[edit]

Chunker[edit]

Determiner Noun[edit]

rulepropertyinformation
   <rule comment="REGLA: det noun">

<pattern>
<pattern-item n="definites"/>
<pattern-item n="noun"/>
</pattern>
<action>
<out>
<chunk name="n" case="caseFirstWord">
<tags>
<tag><lit-tag v="SN"/></tag>
<tag><lit-tag v="def"/></tag>
<tag><clip pos="2" side="tl" part="a_num"/></tag>
<tag><lit-tag v="CD"/></tag>
  </tags>
  <lu>
  <clip pos="2" side="tl" part="lem"/>
  <clip pos="2" side="tl" part="a_pos"/>
<clip pos="2" side="tl" part="a_num"/>
<lit-tag v="4"/><!-- case -->
</lu>
</chunk>
</out>
</action>
</rule>

<rule comment="REGLA: det noun">
	<pattern>
		<pattern-item n="definites"/>
		<pattern-item n="noun"/>
	</pattern>
	<action>
		<out>
			<chunk name="n" case="caseFirstWord">
				<tags>
					<tag><lit-tag v="SN"/></tag>
					<tag><lit-tag v="def"/></tag>
					<tag><clip pos="2" side="tl" part="a_num"/></tag>
					<tag><lit-tag v="CD"/></tag>
				</tags>
				<lu>
					<clip pos="2" side="tl" part="lem"/>
					<clip pos="2" side="tl" part="<span span="color: red;">a_pos</span>"/>
					<clip pos="2" side="tl" part="a_num"/>
					<lit-tag v="4"/><!-- case -->
				</lu>
			</chunk>
		</out>
	</action>
</rule>
pattern matches:I did not see the houses.
relevant categories:
relevant attributes:
<def-attr n="a_num">
	<attr-item tags="sg"/>
	<attr-item tags="pl"/>
	<attr-item tags="ND"/>
</def-attr>