Apertium has moved from SourceForge to GitHub.
If you have any questions, please come and talk to us on #apertium on irc.freenode.net or contact the GitHub migration team.

User:Firespeaker/Transfer rule example

From Apertium
< User:Firespeaker(Difference between revisions)
Jump to: navigation, search
m (Determiner Noun)
(Determiner Noun: attempts at color and formatting :()
 
(One intermediate revision by one user not shown)
Line 9: Line 9:
   
 
=== Determiner Noun ===
 
=== Determiner Noun ===
<table class="wikitable" style="tab-size: 2.5;">
+
<table class="wikitable" style="tab-size: 2;">
 
<tr><th>rule</th><th>property</th><th>information</th></tr>
 
<tr><th>rule</th><th>property</th><th>information</th></tr>
<tr rowspan="3"><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 28:
 
<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 35:
 
</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 43:
 
<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 16:04, 24 April 2019

Contents

[edit] Input text

  • "I did not see the houses."

[edit] Output of tagger

[edit] Chunker

[edit] Determiner Noun

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>
Personal tools