Difference between revisions of "User:Khannatanmai/Secondary tags features"

From Apertium
Jump to navigation Jump to search
(→‎Chunker (t1x): Pull Request: add cat-ita example)
Line 13: Line 13:
 
'''Example Usage (Here the secondary tags show the surface form):'''
 
'''Example Usage (Here the secondary tags show the surface form):'''
   
  +
SPA-ENG
 
Input:
 
Input:
 
<pre>
 
<pre>
Line 21: Line 22:
 
<pre>
 
<pre>
 
^Det_nom<SN><m><pl>{^the<det><def><3><sf:Los>$ ^dog<n><3><sf:perros>$}$ ^de<PREP>{^of<pr><sf:del>$}$ ^det_nom<SN><m><sg>{^the<det><def><3><sf:del>$ ^boy<n><3><sf:chico>$}$ ^verbcj<SV><vblex><pri><p3><pl>{^run<vblex><pres><sf:corren>$}$ ^adj<SA><m><sg>{^fast<adj><sint><sf:rápido>$}$^punt<sent>{^.<sent><sf:.>$}$^punt<sent>{^.<sent><sf:.>$}$[][ ]
 
^Det_nom<SN><m><pl>{^the<det><def><3><sf:Los>$ ^dog<n><3><sf:perros>$}$ ^de<PREP>{^of<pr><sf:del>$}$ ^det_nom<SN><m><sg>{^the<det><def><3><sf:del>$ ^boy<n><3><sf:chico>$}$ ^verbcj<SV><vblex><pri><p3><pl>{^run<vblex><pres><sf:corren>$}$ ^adj<SA><m><sg>{^fast<adj><sint><sf:rápido>$}$^punt<sent>{^.<sent><sf:.>$}$^punt<sent>{^.<sent><sf:.>$}$[][ ]
  +
</pre>
  +
  +
CAT-ITA
  +
Input:
  +
<pre>
  +
^Apertium<np><al><m><sg><sf:Apertium>/Apertium<np><org><m><sg><sf:Apertium>$ ^ser<vbser><pri><p3><sg><sf:és>/essere<vbser><pri><p3><sg><sf:és>$ ^un<det><ind><f><sg><sf:una>/un<det><ind><f><sg><sf:una>$ ^plataforma<n><f><sg><sf:plataforma>/piattaforma<n><f><sg><sf:plataforma>$ ^de<pr><sf:de>/di<pr><sf:de>$ ^traducció<n><f><sg><sf:traducció>/traduzione<n><f><sg><sf:traducció>$ ^automàtic<adj><f><sg><sf:automàtica>/automatico<adj><f><sg><sf:automàtica>$ ^lliure<adj><mf><sg><sf:lliure>/libero<adj><GD><sg><sf:lliure>$ ^i<cnjcoo><sf:i>/e<cnjcoo><sf:i>$ ^obert<adj><f><sg><sf:oberta>/aperto<adj><f><sg><sf:oberta>$^.<sent><sf:.>/.<sent><sf:.>$
  +
</pre>
  +
  +
Output without modification:
  +
<pre>
  +
^np<SN><m><sg>{^Apertium<np><org><m><sg>$}$ ^essere<SV><vbser><pri><p3><sg>{^essere<vbser><pri><p3><5>$}$ ^det_nom<SN><f><sg><sl_f><sl_sg>{^un<det><ind><2><3>$ ^piattaforma<n><2><3>$}$ ^default<default>{^di<pr><sf:de>$}$ ^nom_adj_adj<SN><f><sg><sl_f><sl_sg>{^traduzione<n><2><3>$ ^automatico<adj><2><3>$ ^libero<adj><2><3>$}$ ^default<default>{^e<cnjcoo><sf:i>$}$ ^adj<SA><f><sg>{^aperto<adj><2><3>$}$^default<default>{^.<sent><sf:.>$}$
  +
</pre>
  +
  +
Output after modification:
  +
<pre>
  +
^np<SN><m><sg>{^Apertium<np><org><m><sg><sf:Apertium>$}$ ^essere<SV><vbser><pri><p3><sg>{^essere<vbser><pri><p3><5><sf:és>$}$ ^det_nom<SN><f><sg><sl_f><sl_sg>{^un<det><ind><2><3><sf:una>$ ^piattaforma<n><2><3><sf:plataforma>$}$ ^di<pr>{^di<pr><sf:de>$}$ ^nom_adj_adj<SN><f><sg><sl_f><sl_sg>{^traduzione<n><2><3><sf:traducció>$ ^automatico<adj><2><3><sf:automàtica>$ ^libero<adj><2><3><sf:lliure>$}$ ^cnjcoo<cnjcoo>{^e<cnjcoo><sf:i>$}$ ^adj<SA><f><sg>{^aperto<adj><2><3><sf:oberta>$}$^.<sent>{^.<sent><sf:.>$}$
 
</pre>
 
</pre>

Revision as of 14:24, 13 May 2020

This page will list all the features being added to the pipe to deal with secondary tags. To follow updates on the development, see User:Khannatanmai/New_Apertium_stream_format. This was done as part of the Google Summer of Code 2020. User:Khannatanmai/GSoC2020Proposal_Trimming. User:Khannatanmai/GSoC2020Progress.

Module-specific features

Chunker (t1x): Pull Request

  • Secondary tags (sectags) are ignored while pattern matching for rules.
  • Attribute "tags" (in t1x) gets only primary and not secondary tags. (Ensures no regression)
  • "whole" gets the whole LU including secondary tags.
  • New attribute "sectags" gets all secondary tags. (can be used in clip).
  • Secondary tags are added in the output LU from the LU that the lem/lemh is clipped from.
  • If the lem/lemh comes from a variable in the output then the stags come from the LU which the lemma comes from, by tracing its variable assignment in <let>.
  • No regression. Stream without secondary tags work as-is.

Example Usage (Here the secondary tags show the surface form):

SPA-ENG Input:

^El<det><def><m><pl><sf:Los>/The<det><def><m><pl><sf:Los>$ ^perro<n><m><pl><sf:perros>/dog<n><m><pl><sf:perros>$ ^de<pr><sf:del>/of<pr><sf:del>/from<pr><sf:del>$ ^el<det><def><m><sg><sf:del>/the<det><def><m><sg><sf:del>$ ^chico<n><m><sg><sf:chico>/boy<n><sg><sf:chico>$ ^correr<vblex><pri><p3><pl><sf:corren>/run<vblex><pri><p3><pl><sf:corren>$ ^rápido<adj><m><sg><sf:rápido>/fast<adj><sint><m><sg><sf:rápido>$ ^.<sent><sf:.>/.<sent><sf:.>$ ^.<sent><sf:.>/.<sent><sf:.>$[][ ]

Output:

^Det_nom<SN><m><pl>{^the<det><def><3><sf:Los>$ ^dog<n><3><sf:perros>$}$ ^de<PREP>{^of<pr><sf:del>$}$ ^det_nom<SN><m><sg>{^the<det><def><3><sf:del>$ ^boy<n><3><sf:chico>$}$ ^verbcj<SV><vblex><pri><p3><pl>{^run<vblex><pres><sf:corren>$}$ ^adj<SA><m><sg>{^fast<adj><sint><sf:rápido>$}$^punt<sent>{^.<sent><sf:.>$}$^punt<sent>{^.<sent><sf:.>$}$[][ ]

CAT-ITA Input:

^Apertium<np><al><m><sg><sf:Apertium>/Apertium<np><org><m><sg><sf:Apertium>$ ^ser<vbser><pri><p3><sg><sf:és>/essere<vbser><pri><p3><sg><sf:és>$ ^un<det><ind><f><sg><sf:una>/un<det><ind><f><sg><sf:una>$ ^plataforma<n><f><sg><sf:plataforma>/piattaforma<n><f><sg><sf:plataforma>$ ^de<pr><sf:de>/di<pr><sf:de>$ ^traducció<n><f><sg><sf:traducció>/traduzione<n><f><sg><sf:traducció>$ ^automàtic<adj><f><sg><sf:automàtica>/automatico<adj><f><sg><sf:automàtica>$ ^lliure<adj><mf><sg><sf:lliure>/libero<adj><GD><sg><sf:lliure>$ ^i<cnjcoo><sf:i>/e<cnjcoo><sf:i>$ ^obert<adj><f><sg><sf:oberta>/aperto<adj><f><sg><sf:oberta>$^.<sent><sf:.>/.<sent><sf:.>$

Output without modification:

^np<SN><m><sg>{^Apertium<np><org><m><sg>$}$ ^essere<SV><vbser><pri><p3><sg>{^essere<vbser><pri><p3><5>$}$ ^det_nom<SN><f><sg><sl_f><sl_sg>{^un<det><ind><2><3>$ ^piattaforma<n><2><3>$}$ ^default<default>{^di<pr><sf:de>$}$ ^nom_adj_adj<SN><f><sg><sl_f><sl_sg>{^traduzione<n><2><3>$ ^automatico<adj><2><3>$ ^libero<adj><2><3>$}$ ^default<default>{^e<cnjcoo><sf:i>$}$ ^adj<SA><f><sg>{^aperto<adj><2><3>$}$^default<default>{^.<sent><sf:.>$}$

Output after modification:

^np<SN><m><sg>{^Apertium<np><org><m><sg><sf:Apertium>$}$ ^essere<SV><vbser><pri><p3><sg>{^essere<vbser><pri><p3><5><sf:és>$}$ ^det_nom<SN><f><sg><sl_f><sl_sg>{^un<det><ind><2><3><sf:una>$ ^piattaforma<n><2><3><sf:plataforma>$}$ ^di<pr>{^di<pr><sf:de>$}$ ^nom_adj_adj<SN><f><sg><sl_f><sl_sg>{^traduzione<n><2><3><sf:traducció>$ ^automatico<adj><2><3><sf:automàtica>$ ^libero<adj><2><3><sf:lliure>$}$ ^cnjcoo<cnjcoo>{^e<cnjcoo><sf:i>$}$ ^adj<SA><f><sg>{^aperto<adj><2><3><sf:oberta>$}$^.<sent>{^.<sent><sf:.>$}$