0 votes

I realised this morning that it is possible to generate tags using literal strings. It is, however, a bit of a hack, because it relies on knowing that Apertium puts tags in <> and it feels to me that the FlexTrans user really shouldn’t be relying on such details.
However, it means that, having extracted basic information from the input stream (like noun class) into a literal string variable (e.g., var v_noun_class := string ‘3’), one can do something like:

let var v_gloss = “<”
append var v_gloss “NPx”
append var v_gloss “_”
append var v_gloss var v_noun_class
append var v_gloss “>”

… and then output var v_gloss and the result will synthesize correctly (just as if I had output the literal tag NPx_3)

In my case, it means I can also generate a suffix tag in a separate variable, just changing NPx to NSx – which is a lot easier (and more readable) than managing a big choose whenwhenwhen … structure for each output affix tag that includes noun class information and something more.

So on the one hand, it seems to be an ugly hack, and on the other, it allows more elegant and readable generation of complicated affix tags. What are your thoughts on this approach?

Cheers, bruce

FLExTrans by (102 points)
reshown

1 Answer

0 votes

Yes, it’s a bit of a hack, but seems like a useful one that ultimately makes your rule more maintainable.

By the way, you can append multiple things to a variable (or anything else):

APPEND VAR v_gloss LIT_STR “<NPx_” VAR v_noun_class LIT_STR “>”

Well done!

by (172 points)

Related questions

0 votes
1 answer
FLExTrans Apr 22, 2022 asked by rmdiamondl (172 points)
0 votes
1 answer
0 votes
1 answer
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Give proper recognition to those widows who are really in need.
1 Timothy 5:3
2,477 questions
5,170 answers
4,866 comments
1,282 users