I have improved the FLEx LibreOffice interlinear exporter

173 views
Skip to first unread message

Moss Doerksen

unread,
Jan 31, 2018, 4:14:48 AM1/31/18
to FLEx list

FLEx has never had a way to export properly formatted interlinear texts with word-aligned glosses for MS Word and OpenOffice/LibreOffice formats. I have rectified that with the attached export template. Besides making the glosses word-aligned, I also made some other formatting improvements which you can see in the image below. Note that each sentence is now an item on a numbered list. I also implemented a feature where missing glosses are marked as '???' rather than nothing. Oh, it also uses angle <brackets> to mark infixes. I don't think that was originally a feature.


i would appreciate it if people could try out this new export template and see if they run into any issues. I rather naively mucked around with a copy of the original OO/LO template and I probably broke things in the process. I don't know all the possibilities with FLEx and my understanding of XML is limited. All I can say is it works for the texts and features that I have tried.


Perhaps some day I can make a version for Word too, however, OO/LO have a much better way of handling interlinear texts by using inline text boxes which can automatically shift and wrap as space allows and always stay perfectly aligned — no need to fuss with tabs or macros to keep things aligned.



New FLEx ODT export template.zip

Larry Hayashi

unread,
Feb 18, 2018, 9:35:33 PM2/18/18
to FLEx list
Very nice formatting Moss. I tried it on a few databases and it mostly work although it exports ALL interlinear lines regardless of the settings in the text itself (i.e. all levels of analysis) and for some reason is putting a number of question marks where it shouldn't. Your NEW is on the left, the OLD is on the right. The formatting that you are using is more in keeping with standard linguistic exampling for publication where we butt the affixes up against the root. Nice.

Moss Doerksen

unread,
Feb 19, 2018, 1:59:35 AM2/19/18
to FLEx list
Thanks Larry! You are the first person to give me feedback. Are you sure that you do not have all those lines turned on in the Print View tab? I haven't come across any issues where lines that are not turned on in the print view still show up in the export. I don't know how the template could have any control over that. But maybe there is something special about the file you are testing on that I don't know about. If you double-check that and it is in fact outputting those lines erroneously, then maybe I need to look at your FLEx file. Out of curiousity, what is that line in the middle that has only some question marks and some blank spots? (What style is it using when you click on the question marks?)

It looks like there is a problem with the diacritics too, because it is using a different font? Is the new version using Liberation Serif instead of Doulos SIL? I don't recall changing that, but that is what my output is doing. I just assumed it was some setting in FLEx. But I probably can and should make Doulos SIL the default font for all the lines. That was a good thing to catch.

I see that the clitics are still given a separate slot, but they should be stuck to stems like affixes, shouldn't they? Or I guess that depend on how they are treated in the vernacular orthography. If they are separate words in the base text then I guess they need to be separate words in the gloss.

Now that I think of it, the free translation should be wrapped in quotes.

Jim Kornelsen

unread,
Feb 19, 2018, 4:16:22 PM2/19/18
to flex...@googlegroups.com
LibreOffice LingTools can create word-glossed interlinear examples from Flex, and free translations can optionally be quoted.




--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to the Google Groups "FLEx list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+unsubscribe@googlegroups.com.
To post to this group, send email to flex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flex-list/392123c6-bb2e-49ae-889f-bfc203d394d7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Larry Hayashi

unread,
Feb 19, 2018, 4:29:40 PM2/19/18
to FLEx list
Thanks Jim. I had forgotten to mention those tools. I have been wanting to develop a stylesheet for Field Methods class that uses LibreOffice instead of Word ... your reminder will push me to do so.  There used to be a few things that I could not do in LibreOffice particularly with autonumbering of examples, referencing those examples in a paragraph and use of Zotero but looks like those are no longer issues. 


On Wednesday, January 31, 2018 at 1:14:48 AM UTC-8, Moss Doerksen wrote:

Andreas_Joswig

unread,
Feb 20, 2018, 12:23:05 AM2/20/18
to flex...@googlegroups.com
O can confirm that automatic numbering, crossreferencing these automatic numbers and use of Zotero are all working very fine in LibreOffice, already for at least six or seven years, when I started using LO for my dissertation.
Andreas
--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to the Google Groups "FLEx list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+...@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.

Moss Doerksen

unread,
Feb 21, 2018, 9:23:53 AM2/21/18
to flex...@googlegroups.com
Hmm. I did already have the LingTools extension installed in LibreOffice, but I hadn't really looked at it yet. I tried figuring it out now, but when I loaded an interlinear XML file and tried inserting examples it just said "Did not find any data" in the file. I would like to see how the inserted examples look, but even if it did work, it seems like an awkward way to insert examples, compared to just copying and pasting from another ODT file (exported from FLEx), because you can't directly see the example you are grabbing but have to look up the reference number first.


On Tuesday, February 20, 2018, Andreas_Joswig <andreas...@sil.org> wrote:
O can confirm that automatic numbering, crossreferencing these automatic numbers and use of Zotero are all working very fine in LibreOffice, already for at least six or seven years, when I started using LO for my dissertation.
Andreas

On 02/20/2018 12:29 AM, Larry Hayashi wrote:
Thanks Jim. I had forgotten to mention those tools. I have been wanting to develop a stylesheet for Field Methods class that uses LibreOffice instead of Word ... your reminder will push me to do so.  There used to be a few things that I could not do in LibreOffice particularly with autonumbering of examples, referencing those examples in a paragraph and use of Zotero but looks like those are no longer issues. 

On Wednesday, January 31, 2018 at 1:14:48 AM UTC-8, Moss Doerksen wrote:

FLEx has never had a way to export properly formatted interlinear texts with word-aligned glosses for MS Word and OpenOffice/LibreOffice formats. I have rectified that with the attached export template. Besides making the glosses word-aligned, I also made some other formatting improvements which you can see in the image below. Note that each sentence is now an item on a numbered list. I also implemented a feature where missing glosses are marked as '???' rather than nothing. Oh, it also uses angle <brackets> to mark infixes. I don't think that was originally a feature.


i would appreciate it if people could try out this new export template and see if they run into any issues. I rather naively mucked around with a copy of the original OO/LO template and I probably broke things in the process. I don't know all the possibilities with FLEx and my understanding of XML is limited. All I can say is it works for the texts and features that I have tried.


Perhaps some day I can make a version for Word too, however, OO/LO have a much better way of handling interlinear texts by using inline text boxes which can automatically shift and wrap as space allows and always stay perfectly aligned — no need to fuss with tabs or macros to keep things aligned.



--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to the Google Groups "FLEx list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+unsubscribe@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flex-list/ff2ffc5c-7d7d-4606-b468-a425abe4c8cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to a topic in the Google Groups "FLEx list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flex-list/bZ4x6TUSMz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flex-list+unsubscribe@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.

Brendon

unread,
Feb 21, 2018, 1:46:46 PM2/21/18
to FLEx list
I'm just starting to write my dissertation. The LibreOffice Ling tools extension looks like it could be really useful. When trying it out just now, I ran into a potential problem involving inserting unique identifiers into Flex lexical entries. It seems that the only way to insert phonology examples is to have a unique ID for each entry. Is there a way to at least semi-automate the process of inserting unique IDs? Any ideas about how to keep the unique IDs consistent as the lexical database grows and changes?

Brendon
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+...@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.

Larry Hayashi

unread,
Feb 21, 2018, 7:13:35 PM2/21/18
to flex...@googlegroups.com
Andreas, could you post an empty LibreOffice document with the styles that you are using for your dissertation. (Or if you have a stylesheet with placeholder examples in it, even better!) This could save considerable time in developing a stylesheet. I remember having difficulties with numbered examples when there were indented a., b., c. included underneath the (#). I seem to remember not being able to cross-reference to those. It has been quite awhile though since I tried.

On Mon, Feb 19, 2018 at 9:22 PM, Andreas_Joswig <andreas...@sil.org> wrote:
O can confirm that automatic numbering, crossreferencing these automatic numbers and use of Zotero are all working very fine in LibreOffice, already for at least six or seven years, when I started using LO for my dissertation.
Andreas

On 02/20/2018 12:29 AM, Larry Hayashi wrote:
Thanks Jim. I had forgotten to mention those tools. I have been wanting to develop a stylesheet for Field Methods class that uses LibreOffice instead of Word ... your reminder will push me to do so.  There used to be a few things that I could not do in LibreOffice particularly with autonumbering of examples, referencing those examples in a paragraph and use of Zotero but looks like those are no longer issues. 

On Wednesday, January 31, 2018 at 1:14:48 AM UTC-8, Moss Doerksen wrote:

FLEx has never had a way to export properly formatted interlinear texts with word-aligned glosses for MS Word and OpenOffice/LibreOffice formats. I have rectified that with the attached export template. Besides making the glosses word-aligned, I also made some other formatting improvements which you can see in the image below. Note that each sentence is now an item on a numbered list. I also implemented a feature where missing glosses are marked as '???' rather than nothing. Oh, it also uses angle <brackets> to mark infixes. I don't think that was originally a feature.


i would appreciate it if people could try out this new export template and see if they run into any issues. I rather naively mucked around with a copy of the original OO/LO template and I probably broke things in the process. I don't know all the possibilities with FLEx and my understanding of XML is limited. All I can say is it works for the texts and features that I have tried.


Perhaps some day I can make a version for Word too, however, OO/LO have a much better way of handling interlinear texts by using inline text boxes which can automatically shift and wrap as space allows and always stay perfectly aligned — no need to fuss with tabs or macros to keep things aligned.



--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to the Google Groups "FLEx list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+unsubscribe@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flex-list/ff2ffc5c-7d7d-4606-b468-a425abe4c8cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to a topic in the Google Groups "FLEx list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flex-list/bZ4x6TUSMz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flex-list+unsubscribe@googlegroups.com.
To post to this group, send email to flex...@googlegroups.com.

Moss Doerksen

unread,
Feb 21, 2018, 7:26:03 PM2/21/18
to flex...@googlegroups.com
Perhaps a new discussion thread should be started for questions about using LingTools, so that this one can be focused on feedback about my revised export template.

I don't know what a phonology example is, but as far as interlinear examples go, it seems to me that exporting an ODT from FLEx and then copying the exported examples into a paper is a better method than what LingTools offers. Mind you, I can't get LingTools to work. 

Comparisons between this revised ODT FLEx export template and other methods of getting interlinear examples into a paper are appropriate for this thread.
You received this message because you are subscribed to a topic in the Google Groups "FLEx list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flex-list/bZ4x6TUSMz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flex-list+unsubscribe@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.

Jim Kornelsen

unread,
Feb 22, 2018, 4:16:31 PM2/22/18
to flex...@googlegroups.com
When I loaded an interlinear XML file and tried inserting examples it just said "Did not find any data" in the file .

Please send me a copy of the FLEXTEXT XML file that did not work.
If it's too large, use Dropbox or Google Drive.


 It seems like an awkward way to insert examples... because you can't directly see the example you are grabbing but have to look up the reference number first.

I find it convenient because with FieldWorks open, look at the example, make any needed modifications in Flex, and then go back to LibreOffice to insert the example.
Flex also allows sorting entries to find what you want more easily than searching through an exported list.
And examples can be automatically updated if the data changes later. 

In contrast, to me the copy-paste-from-a-large-exported-list approach seems awkward because to fix the example, it is necessary to go back to Flex.
That means there are three windows instead of two to search through and keep updated.
And then what happens if the example needs to be modified later?
Each place where that example is used would need to be updated, being careful not to change any auto-numbered cross-referenced fields.


 Is there a way to at least semi-automate the process of inserting unique IDs?

Awhile back I requested automatic IDs for the lexicon similar to the numbered interlinear entries in Flex, but the developers were not interested in adding this.
So instead, I wrote a python script to automatically add unique IDs using Bulk Edit Entries.
Some setup is required the first time, but after that, it should not be too difficult to run again whenever new IDs need to be added.

-Jim K

Hugh Paterson

unread,
Feb 22, 2018, 4:20:30 PM2/22/18
to flex...@googlegroups.com
@Brendon Yoder

for writing a dissertation I strongly suggest looking at XLingpaper instead of LibreOffice. You can also do data examples via import.

- Hugh

To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+unsubscribe@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.

Kent Rasmussen

unread,
Feb 22, 2018, 5:28:17 PM2/22/18
to flex...@googlegroups.com
Hear, Hear! (and see mine here, if you're not sure what XLP can do)

On 02/22/2018 03:19 PM, Hugh Paterson wrote:
@Brendon Yoder

for writing a dissertation I strongly suggest looking at XLingpaper instead of LibreOffice. You can also do data examples via import.

- Hugh
--
Kent Rasmussen
SIL Eastern Congo Group Linguistics Consultant / Conseiller en Linguistique de SIL au Congo de l'Est
Orthographies for eastern DRC / Orthographes pour la RDC de l'est

Andreas_Joswig

unread,
Feb 22, 2018, 11:59:01 PM2/22/18
to flex...@googlegroups.com
See attachment. So it probably is not quite what you want or need, as indeed I also did not find a way to automatically reference sub-examples, just manually. I decided that it would not matter, and indeed, in all the many times I had to rearrange my dissertation, there was only one time when I had to remove some sub-examples, and then check for the integrity of the surrounding references. Note that I still referenced the main example number with this system, and that was really the only thing that ever changed.
Andreas


On 02/22/2018 03:13 AM, Larry Hayashi wrote:
Stylesheet.odt

Moss Doerksen

unread,
Feb 24, 2018, 4:22:29 AM2/24/18
to flex...@googlegroups.com
Oh, I see now, it has to be a FLEXTEXT file. I was trying to use a generic XML file exported from FLEx. The LingTools plugin just asks for "Interlinear XML files from Toolbox or Fieldworks". So I didn't know.

I got it working now. Interesting. I guess the one advantage I see with LingTools over just using an ODT export and copying examples in (now that I have improved the ODT export) is that you can update your examples. If you needed to make a batch change to many examples in a paper that could be handy, although search and replace might work too. And for a single example it wouldn't really make a difference.
--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to a topic in the Google Groups "FLEx list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flex-list/bZ4x6TUSMz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flex-list+unsubscribe@googlegroups.com.
To post to this group, send email to flex...@googlegroups.com.

Brendon

unread,
Feb 24, 2018, 5:16:33 PM2/24/18
to FLEx list
Hugh and Kent,

Thanks for the recommendation. I'm looking into XLingPaper, although at the moment I'm not sure it's going to be the best choice for my purposes.

Brendon

Hugh Paterson

unread,
Feb 24, 2018, 6:50:41 PM2/24/18
to flex...@googlegroups.com
@Brendon

some of your choice on writing tools is going to depend on how picky your graduate school is on stylesheet application, and on how you might want to type set the work for formal publication post-defense. XLingPaper works great here... if you have an advisor who only works with MS Docs and that commenting system, you can export to that from XLingPaper too. I know a GIAL student who worked that way. You can also import your references from endnote and zotero to us in XLingPaper.  The author Andy Black is really responsive, and helpful in getting XLingPaper to facilitate typesetting situations common to linguistics.

But the truth is, we all have to pick our poison when we start down the road of choosing authorship tools.

- Hugh

--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to the Google Groups "FLEx list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+unsubscribe@googlegroups.com.
To post to this group, send email to flex...@googlegroups.com.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Moss Doerksen

unread,
May 2, 2018, 4:06:57 AM5/2/18
to FLEx list
I have made a number of enhancements and fixes to my ODT exporter including quotation marks around the Free translation, and moving punctuation inside the text box of the previous word. I have tried attaching it to this message, but the message refuses to post, so now I am trying it without the attachment...

I would appreciate it if people writing papers in LibreOffice would use this and let me know what they think.

Moss
To unsubscribe from this group and stop receiving emails from it, send an email to flex-list+...@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.
Message has been deleted
Message has been deleted

Moss Doerksen

unread,
May 2, 2018, 4:14:36 AM5/2/18
to FLEx list
OK, for some reason attaching files is no longer working, so I have put it on Google drive https://drive.google.com/open?id=158EQw22m_-h6g7J90WTAzr101t3Hr1sm.

RKN

unread,
May 6, 2018, 3:12:15 AM5/6/18
to FLEx list
How to do this in Ubuntu?

Moss Doerksen

unread,
May 16, 2018, 1:24:31 AM5/16/18
to flex...@googlegroups.com
I guess you would have to find the installation location for FLEx in Linux and then put the new template files in the appropriate subfolder according to the readme.txt.

On Sun, May 6, 2018 at 12:12 AM, RKN <karthick...@gmail.com> wrote:
How to do this in Ubuntu?
--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to a topic in the Google Groups "FLEx list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flex-list/bZ4x6TUSMz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flex-list+unsubscribe@googlegroups.com.

To post to this group, send email to flex...@googlegroups.com.

RKN

unread,
May 17, 2018, 1:36:41 AM5/17/18
to FLEx list
Ok, I will try it out and post the updates if any here.
Thank you.

On Wednesday, 16 May 2018 10:54:31 UTC+5:30, Moss Doerksen wrote:
I guess you would have to find the installation location for FLEx in Linux and then put the new template files in the appropriate subfolder according to the readme.txt.
On Sun, May 6, 2018 at 12:12 AM, RKN <karthick...@gmail.com> wrote:
How to do this in Ubuntu?

--
You are subscribed to the publicly accessible group "FLEx list".
Only members can post but anyone can view messages on the website.
To change your status, please write to flex_d...@sil.org.
You can join this group by going to http://groups.google.com/group/flex-list.
---
You received this message because you are subscribed to a topic in the Google Groups "FLEx list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/flex-list/bZ4x6TUSMz0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to flex-list+...@googlegroups.com.

RKN

unread,
May 17, 2018, 2:17:13 AM5/17/18
to FLEx list
 So this is how it needs to be done

to do this
Press Alt + F2  run gsku nautilus and
 in the location-bar enter this/usr/share/fieldworks/Language Explorer/Export Templates/Interlinear or naviage to this  location, 
Copy XML file and  XSL files in the zip folder to the above location
in the export option of interlinear use the new "OpenOffice/LibreOffice Writer NEW"


Thank you Moss it is good than the default option.

Moss Doerksen

unread,
Jun 13, 2018, 10:10:01 PM6/13/18
to FLEx list
I have done one more update to the exporter and uploaded it to the same link. This was to fix a behaviour that I saw in a co-worker's FLEx exports where an entire line of question marks was being inserted for no apparent reason.

It helps to understand that I re-worked the export template so that it first generates a list for itself of all the unique elements that it sees inside of <morph> elements (I am talking about XML structure here). It uses that list to decide what lines to display in the interlinear: vernacular, gloss, POS, etc. Previously, if data was missing for a morpheme for one of those lines, for example an unglossed word, it would simply print nothing in the interlinear export. Now it is smart enough to know that there should be a <gls> element here, but there isn't so it prints ??? instead, similar to the *** that FLEx displays. This highlights that there is something lacking there, plus it preserves the correct line positioning. If it just prints nothing, then any lines below the missing item will be shifted up onto the incorrect line.

That method was already in place in the last version that I posted. However, it leaves open the possibility that some unforeseen rogue elements may pop in a interlinear text, thus generating an entirely new line in the export which may be mostly filled with question marks, or even be entirely question marks if the rogue element doesn't actually have any visible content. This proved to be the case when there were words that were marked as variants of other words in the lexicon. For some reason these words have '.***' appended on them and in an XML export they generate a <glsAppend> element. I don't know what the point of that is, so I simply added some extra code to the template telling it to explicitly ignore <glsAppend> elements. I don't know what all the ramifications for that might be, but it solved the problem of having a useless line full of question marks. If I understood them better, perhaps a better solution would be to treat them as if they are <gls> elements. I don't know.

In my attempt to solve the problem I also deleted a bunch of other lines of code from the template that seemed to no longer be functional, but I may have been mistaken, so further testing would be good.

Moss
Reply all
Reply to author
Forward
0 new messages