0 votes
114 views

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 | 114 views

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 (336 points)

Related questions

0 votes
1 answer 7 views
What's the best way to handle verb to verb phrase translations? In Mato (source lg) we have harungia 'speak against ... cumbersome, and I'm wondering if there's an easier solution?
matoxltr 122 asked Jul 16, 2025
0 votes
1 answer 117 views
How do I use a macro? (How can I repeat rule statements in multiple places?)
rmdiamondl 336 asked May 8, 2022
0 votes
1 answer 120 views
Can I work on multiple language pairs with FLExTrans?
rmdiamondl 336 asked Apr 22, 2022
0 votes
1 answer 176 views
The command line help says -b BOOKS, --books BOOKS Reference list to print (as in Choose Books) in the github ... while trying to install ptxprint on a new Linux machine also.)
mnjames 1.9k asked May 10, 2023
0 votes
1 answer 18 views
How do I delete a word from the target output?
Sara 246 asked Apr 28, 2025
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Don’t you know that you yourselves are God’s temple and that God’s Spirit dwells in your midst?
1 Corinthians 3:16
3,037 questions
5,994 answers
5,661 comments
2,022 users