Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
user:zeman:interset:how-to-write-a-driver [2009/09/08 15:45] zeman Replacing feature values and the other feature. |
user:zeman:interset:how-to-write-a-driver [2009/09/08 17:46] zeman Current solution. |
||
---|---|---|---|
Line 149: | Line 149: | ||
$fs1 = tagset:: | $fs1 = tagset:: | ||
</ | </ | ||
+ | |||
===== Replacing and the other feature ===== | ===== Replacing and the other feature ===== | ||
Line 163: | Line 164: | ||
**Another possible solution** is to implement a new subroutine that returns the list of the tags that can be used for scanning of permitted feature value combinations. By default, the subroutine would return the list of non-o-tags. For tagsets such as '' | **Another possible solution** is to implement a new subroutine that returns the list of the tags that can be used for scanning of permitted feature value combinations. By default, the subroutine would return the list of non-o-tags. For tagsets such as '' | ||
+ | |||
+ | **Current solution:** New (third) parameter to '' | ||
+ | |||
+ | <code perl> | ||
+ | # Modify the feature structure so that it contains values expected by this | ||
+ | # driver. Do not do that if this was also the source tagset (because the | ||
+ | # modification would damage tags using ' | ||
+ | # create a deep copy of the original feature structure so that it is | ||
+ | # protected from changes during encoding. | ||
+ | my $f; | ||
+ | if($f0-> | ||
+ | { | ||
+ | $f = tagset:: | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | $f = tagset:: | ||
+ | } | ||
+ | my %f = %{$f}; | ||
+ | </ | ||
===== Common problems ===== | ===== Common problems ===== |