0 votes
23 views

Our subtitles in both translations are in Title Case, with all words having the first letter capitalized (no minor, uncapitalized words). In the process of using FLExTrans, sometimes there are phrases (e.g. for key terms) where only the first word in the phrase outputs as capitalized. Additionally, sometimes a demonstrative that is a suffix in the source language is actually a separate word in the target language and outputs as lowercase. The following example shows both issues:

\s1 Haruanga Babuna Mana Sipsipka Hanggalang   >   \s1 Pasilanga babuna Mana Sipsip xa Panggalang

Is there a way in the text out rules to clean this up? Is there a regular expression someone has that works in the text out rules for this?

FLExTrans by (122 points)
reshown by [Administrator]
| 23 views

1 Answer

0 votes

I see what is going on. Your lexical entry is haruanga babuna which is mapped to pasilanga babuna. The capitalization of the first word gets retained but not the second. FLExTrans' transfer engine can't handle this so you will have to do a post-synthesis change.

In the case of Sipsipka going to Sipsip xa, since this gets produced by a rule you could wrap the literal string you are outputting with the 'get-case-from' element. It would look like this:

This means if the original word coming in is uppercase, the xa will come out in uppercase. Likewise if it is lowercase, it will come out in lowercase.

But, you may have other words in a section title that are coming out lowercase for various reasons. So you may want a general solution to make all the words title case.

There isn't a one-line regular expression that would do this. So I see two possible solutions:

1) Add a custom module to your Drafting set of modules that would run some Python code to capitalize all words in a section header.

2) Add a regular expression for each letter of the alphabet. This is not so nice to have 26 expressions in your Text Out rules, but it works.

The expression for 'a' would be Search For: (^\\s.*?\b)a(\w*) Replace with: \1A\2

To make it easy to add all these, you can add the following xml lines below <SearchReplaceRules> in the file Output\fixup_synthesis_rules.xml:

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)a(\w*)</SearchString>

   <ReplaceString>\1A\2</ReplaceString>

 </SearchReplaceRule>

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)b(\w*)</SearchString>

   <ReplaceString>\1B\2</ReplaceString>

 </SearchReplaceRule>

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)c(\w*)</SearchString>

   <ReplaceString>\1C\2</ReplaceString>

 </SearchReplaceRule>

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)d(\w*)</SearchString>

   <ReplaceString>\1D\2</ReplaceString>

 </SearchReplaceRule>

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)e(\w*)</SearchString>

   <ReplaceString>\1E\2</ReplaceString>

 </SearchReplaceRule>

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)f(\w*)</SearchString>

   <ReplaceString>\1F\2</ReplaceString>

 </SearchReplaceRule>

 <SearchReplaceRule RegEx="yes" Inactive="no" Comment="">

   <SearchString>(^\\s.*?\b)g(\w*)</SearchString>

   <ReplaceString>\1G\2</ReplaceString>

 </SearchReplaceRule>

etc.

by (336 points)

An improved Regex is:

(^\\s[^\\]*?\b)r(.+?)(?=\\)

the replacement can remain:

\1R\2

The improvement stops making capitalization changes when it gets to the next backslash (\) which is important. 

Related questions

0 votes
1 answer 22 views
How do I run a synthesis self-test on a text in my Target Project?
Sara 246 asked Apr 28, 2025
0 votes
1 answer 171 views
How do I delete an affix in my transfer rules?
rmdiamondl 336 asked May 8, 2022
0 votes
3 answers 357 views
I'm getting Luke and Acts ready to be printed as a booklet, and I can't figure out how to put an intermediate title page before the beginning of Acts.
Jamie 102 asked Aug 6, 2024
0 votes
1 answer 84 views
How do I use the Sample logic that’s in the transfer rules file?
Sara 246 asked Apr 28, 2025
0 votes
1 answer 25 views
How do I refer to affix glosses in transfer rules?
Sara 246 asked Apr 28, 2025
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
For we were all baptized by one Spirit so as to form one body—whether Jews or Gentiles, slave or free—and we were all given the one Spirit to drink.
1 Corinthians 12:13
3,041 questions
5,996 answers
5,663 comments
2,023 users