{'fraction_non_alphanumeric': 0.033361542915683044, 'fraction_numerical': 0.013496058082045343, 'mean_word_length': 4.742199488491049, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modelling Etymology in LMF/TEI: The Grande Dicionário Houaiss da Língua Portuguesa Dictionary as a Use Case

In this article we will introduce two of the new parts of the new multi-part version of the Lexical Markup Framework (LMF) ISO standard, namely part 3 of the standard (ISO 24613-3), which deals with etymological and diachronic data, and Part 4 (ISO 24613-4), which consists of a TEI serialisation of all of the prior parts of the model. We will demonstrate the use of both standards by describing the LMF encoding of a small number of examples taken from a sample conversion of the reference Portuguese dictionary Grande Dicionário Houaiss da Língua Portuguesa, part of a broader experiment comprising the analysis of different, heterogeneously encoded, Portuguese lexical resources. We present the examples in the Unified Modelling Language (UML) and also in a couple of cases in TEI.


Introduction
In this article, we will introduce two parts of the new multi-part version of the Lexical Markup Framework (LMF) International Organization for Standardization (ISO) standard, namely Part 3 of the standard (ISO/DIS 24613-3), which deals with etymological and diachronic data, and Part 4 (ISO/DIS 24613-4), which consists of a TEI serialisation of all of the prior parts of the model (in what follows we will refer to the TEI-XML serialisation of LMF data as LMF in TEI). In particular, we will show how LMF and especially parts 3 and 4 can be used to encode etymological data by taking example encodings of entries from an important reference dictionary for the Portuguese language, the Grande Dicionário Houaiss da Língua Portuguesa (Houaiss, 2015), from now on Houaiss. Note that although we have previously introduced the new version LMF standard as a whole (Romary et al., 2019), our aim in the current work is to describe and motivate the particular approach which we, as authors of these two parts of the standard, have taken to representing etymological data, an approach which is closely related to previous work carried out by some of the authors of the current work in TEI and linked data, but which also takes advantage of the increased levels of abstraction offered by LMF over those two other data frameworks. The rest of the article is as follows.
In Section 2., we discuss the LMF as a whole in order to situate ISO 24613-3 and ISO 24613-4 within the broader context of the entire standard; the latter two parts are described in detail in Sections 2.1. and 2.2. respectively. In Section 3., we will give some brief background on the resource (Houaiss) which will furnish us with almost all of our examples in this paper. Next, in Section 4., we will give some illustrative examples from the Houaiss dictionary and describe their encoding in LMF using UML; we will describe the TEI encoding of two of these examples in Section 5. In the conclusion, we describe future work. 1 . The appendix includes further details on combining etymological information from different resources.

The Lexical Markup Framework
The Lexical Markup Framework was first published as a standard in 2008 by ISO (ISO 24613: 2008) having been intended from the first as a "standard framework for the construction of computer lexicons" (Francopoulo et al., 2006). Since that time, it has been used in the creation and publication of lexical resources by several organizations and numerous national and international projects (Francopoulo, 2013). However, as a result of a detailed review of the standard, it was decided, primarily for reasons of lack of modularity and the inadequacy of the serialisation initially associated to the model, that the ISO working group should revise LMF. ISO TC 37/SC 4/WG 4 (Lexical resources) and become a multi-part standard. At the time of writing the first part of the new version has already been published 2 , and four of the other parts are at an advanced stage of completion. The first two parts of the new standard deal with aspects of linguistic description that were already covered in the previous version of LMF but the third and fourth parts are new; the former provides a data model for publishing etymological and (more generally) diachronic lexical information, and the latter constitutes an XML serialisation of the preceding parts following the Text Encoding Initiative guidelines. In summary, the different parts of the revised standard are as follows 3 : • • LBX serialisation (ISO 24613-5): a second serialisation is formalised here using the Language Base Exchange (LBX); Syntax and Semantics (ISO 24613-6): this part gathers together classes and attributes necessary for a detailed encoding of semantic and syntactic information; Morphology (ISO 24613-7): this part gathers together classes and attributes necessary for a detailed encoding of semantic and syntactic information -we do not discuss these parts here.

LMF Parts 1 (ISO 24613-1:2019) and 2 (ISO 24613-2)
The LMF core model, as described in Part 1 (ISO 24613-1:2019) of the standard, consists of classes and attributes deemed to be fundamental for the modelling of computational lexica. It still remains very close to the definition of the core properties of the original 2008 version of LMF. Note also that unlike other parts of the standard its use is mandatory in the definition of LMF lexicons. The LMF core model includes the class Lexical Resource, which serves to group together different individuals of the class Lexicon; the latter class standing as a container for a collection of individuals of the class Lexical Entry. Other fundamental core model classes include Form, Sense, and Definition. One crucial novelty of Part 1 is the class CrossRef, which was not available in the 2008 version of LMF, and which provides a generic linking mechanism for the other classes in the standard: both in the case of linking to external as well as internal resources. Most importantly for our purposes, and as we shall see in the next section, CrossRef is used in the modelling of etymological links. Part 2 of LMF, the Machine Readable Dictionaries module (ISO 24613-2), also includes a number of classes which are essential for our purposes in describing ISO 24613-3. These include Word Form and Bibliography.

LMF Part 3 (ISO/DIS 24613-3)
Our approach to modelling etymologies in LMF has been heavily influenced by prior work in etymology representation both in the 2008 version of LMF (Salmon-Alt, 2006) as well as in other standards such as TEI (Bowers and Romary, 2017) and Ontolex-lemon (Khan, 2018). In particular, we have sought to emphasise the following three aspects of etymologies when representing them as computational resources: 1. their status as descriptions of abstract graphs, i.e., data structures of the kind that computer scientists are (exceedingly) used to working with; 2. the fact that etymologies usually describe the genealogy of a given lexical phenomenon through the use of a narrative (simple in most cases); and finally, 3. the fact that individual etymologies also describe hypotheses (often of a scholarly nature) and tend to include references to other texts in justification of these hypotheses.
Our more general aim in Part 3 has been to abstract away from individual, written, representations of etymologies and to make etymological data encoded in LMF (and which has been potentially taken from a number of diverse sources, and not just necessarily lexicons) as interoperable as possible: that is we are focused more on the content of etymological information than in the exact form in which it is presented in a source text, as is the case in some TEI based approaches. In order to better motivate our particular approach and to make it more intuitive, we will model a very simple case (abstracted from a class of real examples), passing through different levels of complexity of description -and justifying each successive layer of additional descriptive expressivity -before finally arriving at the approach which has been established in LMF Part 3. This will also allow us to introduce individual classes from the standard in turn and give some justification for their inclusion.
Our example case is one in which we are to model the fact that a word has four etymons, e1, e2, e3, e4, in that order (e.g., so that e4 derives from or is borrowed from e3, e3 is derived from or is borrowed from e2, and e2 comes from e1). The first class which we introduce from Part 3, then, is Etymon (which we have modelled as a subclass of the class Lexical Entry from Part 1 of LMF). A simple way of representing the case in hand would, therefore, be as follows: each instance of Etymon links to its succeeding Etymon or Lexical Entry in the chain as in Figure 1. In fact, this would be sufficient for any such similar case in which an etymology is essentially a single ordered sequence of etymons. The limitations of such an approach are however obvious. It does not allow us to describe the steps between an etymon and its succeeding etymon/entry (for instance, to specify whether one etymon or entry has been been borrowed or inherited from another) in a structured way.
We decided to resolve this issue through the expedient of reifying individual etymological links and introducing the class EtyLink in Part 3 as a subclass of the CrossREF class introduced in Part 1 (where the latter, as we previously mentioned, represents a generic means of linking together elements in an LMF resource). This allows us to associate individuals of type EtyLink with each of the etymological links between etymons and etymons/lexical entries in an etymology, as in Figure 2 below. In general, EtyLink allows us to predicate any kind of information we choose to of these individual etymological links, including provenance, certainty, etc. However, once more, this does not suffice in cases where we wish to predicate salient properties of the etymology as a whole, such as, again, its provenance, or to assign a level of certainty to the whole thing; neither does it make allowance for cases where a single entry has more than one etymology. In order to handle these cases (which become more frequent as the resources to be modelled become more 'scholarly') we decided to make etymology a class, Etymology, in Part 3. However since etymologies usually represent an ordering of etymons (and, of course, etymons can be associated with more than one etymology and even more than one etymology for the same entry), we opted to create indirect rather than direct associations between etymologies and etymons. That is, we define etymologies as containers for an ordered series of etymological links, see Figure 3 below. As well as giving us the flexibility we need to describe more than one etymology for the same lexical entry this approach also permits us to re-use etymons and etymological links when relevant, as in Figure 4 where a lexical entry has two etymologies which share three etymons in common. Summing up, we have so far introduced three of the most important new classes which appear in Part 3: Etymology, Etymon, and EtyLink. Other important classes include Cognate and Cognate Set, which we will introduce below in the examples in Section 4.

LMF Part 4 (ISO/DIS 24613-4)
The fourth module in LMF incorporates the encoding alternatives from the TEI standard (Budin et al., 2012) in replacing the old ad-hoc XML serialisation of LMF. Our approach was motivated by earlier work (Romary, 2010;Romary, 2015) which identified modelling analogies between both standards and made concrete proposals towards finding a common serialisation. However given the wide-ranging flexibility that exists in the TEI schema for encoding a given lexical structure, we decided to build on the most common practices within the TEI community while aligning our directives with those of related initiatives, namely the TEI-Lex0 guidelines (Romary and Tasovac, 2018). Part 4 of the standard, therefore provides guidelines for serialising the first three parts and their mutual relationships. In this section, we focus on the serialisation mechanisms including those pertaining to the etymological components of the standard (e.g. Part 3). Following the earlier proposals made in (Bowers and Romary, 2017), the design of a TEI serialisation for Part 3 is based on the following elementary constructs: • The Etymology class is (obviously) serialised by means of the <etym/> element. In case there is a necessity to specify an etymological process it can be expressed by means of the @type attribute, whose possible values can be taken from the normative Annex B of LMF Part 3 (e.g. "borrowing", "inheritance", "metaphor", "metonymy", "compounding", "grammaticalization", among others.); • The Etymon class is interpreted as the citation of a lexical object by means of the <cit type="etymon"/> construct which in turn will contain the various components that may characterize a given etymon; • Referencing a form for an etymon is seen in LMF Part 4 as a descriptive mechanism that parallels the provision of a form in a lexical entry. It is thus implemented with a <form> element, together with its possible sub-components (e.g. <orth> for orthography or <pron> for pronunciation): <form> <pron>...</pron> <orth>...</orth> </form> • The CognateSet and Cognate classes are also both serialised by means of the <cit/> element with the differentiation being made by specifying the @type attribute and the possibility to nest Cognates in a CognateSet construct: <cit type="cognateSet"> <cit type="cognate">..</cit> <cit type="cognate">..</cit> </cit> • These core constructs are complemented with a variety of components taken up from the TEI guidelines to elicit the language of the etymon (<lang>), to express date information (<date>), to provide the source of an etymology or an etymon (<bibl>).

Modelling Etymology in TEI via LMF. A Case Study: the Grande Dicionário Houaiss da Língua Portuguesa
In the following sections, we shall illustrate the use of the classes introduced in Section 2.2. by reference to an actual case study: namely, the conversion a number of sample entries from an existing reference dictionary into TEI. The dictionary in question, Houaiss (Houaiss, 2015), constitutes an adaptation to European Portuguese of the original Brazilian Portuguese dictionary of the same name (Houaiss, 2001); the latter was the result of the most extensive and ambitious lexicographic project ever realised in Brazil, and was originally published in Rio de Janeiro by the Antônio Houaiss Institute. The adaptation of the dictionary to European Portuguese was carried out by the Dictionary Department of Porto Editora. The resulting edition, published in 6 volumes, was a joint-publication of Círculo de Leitores and the Antônio Houaiss Institute with financial support from the Calouste Gulbenkian Foundation. In Figure 5, we give an example entry from the Houaiss. A golden diamond symbol introduces the etymology field of an entry and typically includes an 'immediate' etymon for the entry (the most recent of its etymons listed in the dictionary) and also in many cases other, earlier 'remote', etymons. The immediate etymon is in presented italics, preceded by a source language identifier, and succeeded by a gloss in Portuguese.

Example Encodings in LMF
In this section, we will look at three examples from our ongoing conversion of a sample of the Houaiss into TEI via LMF 4 and show how they can be represented in LMF UML. The examples, which show the use of the classes introduced in Section 2 in modelling actual dictionary entries, were chosen because of their representativity and in particular, they exemplify the following salient cases: 1) an undefined etymology (cócoras); 2) a borrowed lexical unit (opalina); 3) the existence of a cognate set (sapato). Our first example is the Houaiss entry for the word cócoras 'squat', as shown in Figure 6. The etymological section of the Houaiss entry for cócoras starts with an acknowledgement of the obscurity of the etymol-4 Note that our focus is only on the LMF encoding of the etymological field in each entry. We do not therefore explicitly encode the rest of the information included in the entry here although LMF does offer provision for this across its different modules. ogy of the word ('etim orig.contrv. ou mesmo obsc.') and follows it up with three different etymological hypotheses. The first, attributed to the Spanish lexicographer Vicente Garcia de Diego 5 , proposes an onomatopoeic origin for the word; the second associates it with the Latin etymon glocire 6 ; the third with the Latin etymon quacquara 7 . Our LMF encoding, given in Figure 7, represents each of these etymologies as separate individuals of class Etymology, each of which is associated with the Lexical Entry for the word. In turn, each of these Etymology individuals is associated with an individual of the EtyLink class which, in both cases, links the lexical entry with a Latin etymon. The purple coloured boxes in Fig 7 represent the information in the first etymological hypotheses; the light blue boxes the second hypothesis; the light green boxes represent the third hypothesis. Instances of the class Bibliography are used to give provenance information for each etymology. Our second example concerns the Houaiss entry for the word opalina 'opaline', see Fig 5, which has three senses: 1) a kind of milky translucent glass; 2) objects made from this glass (metonomy); 3) a white glass used to tile walls, roofs. The entry's etymology gives the French opaline as an immediate etymon; it also specifies that the original sense, not listed as a separate sense in the entry, was 'a parasitic infusory found in frog bellies' 8 . In the LMF encoding, given in Figure   5 Garcia de Diego declara-a de orig. onom ("Garcia de Diego declares it to be of onomatopoeic origin".) 6 no REW (no 3795), vincula-se a loc. (ao lado de diversas formas românicas e do v. acocorinhar-se) ao v. lat. glocíre 'cacarejar', prov. por alusão ao choco das galinhas. ("in REW (no. 3795) it is linked (along with various Romance forms and the verb acocorinhar-se) to the vulgar Latin glocíre 'cluck' probably by reference to incubation by hens.") 7 J. Piel prende, com dúvida, ao lat. popular quacquara 'codorniz', pois, segundo esse autor, teria sido 'a imagem da codorniz agachada no solo (atitude que a confunde com o terreno, tornandoa quase invisível ao caçador), que deu origem ao v. acocorar(-se), acocorinhar(-se), pôr de cócoras etc.'("J. Piel proposes, although doubtfully, the Vulgar Latin quacquara 'quail' because according to this author, 'the image of the quail crouched on the ground (a stance that confounds it with its terrain, making it almost invisible to hunters), may have given rise to the verb acocorar(-se), acocorinhar(-se), pôr de cócoras etc") 8 a dataçãoé para a acp., não registada aqui, 'género de in-  1, an Etymology individual for the entry is associated with an etymological link between a French Etymon and the Portuguese Lexical Entry 9 . The example also fusórios que se encontra no ventre das rãs' ("the dating given is for the sense, not recorded here, of 'type of infusoria found in the abdomen of frogs'") 9 Note that within the LMF model there is provision for specifying that the link is between a particular sense of the shows an instance of the Date class as well as showing how sense glosses are represented using Definition. The next example demonstrates the use of the LMF Part 3 class Cognate Set, defined as a container for a set of individuals of the class Cognate. The example concerns the Houaiss entry for the word sapato 'shoe', given in Figure 2. After remarking on the obscure etymology of the word, the entry lists a number of cognates in related languages 10 . The LMF encoding for sapato is given in Figure 10. In this case, the Lexical Entry is linked with an individual of the class Cognate-Set to which various different cognates are associated.
In the appendix we include a brief description of an entry that combines information from two different resources.

Encoding the Houaiss Examples in TEI
In this section, we will look at the TEI encoding based on the serialisation introduced in LMF Part 4, of some of the etymologies which we presented above. As outlined in section 2.3., the TEI guidelines provide an optimal combination of semantically rich constructs for LMF Part 3 etymological descriptions along with additional mechanism to mark-up the source text in   cases in which the encoding intends to be as faithful to the original representation of a lexical entry. The first example (See Listing 1 11 ) shows the entry for opalina, which has been described in Section 4.. In the case of this simple etymological description, we have an <etym> element (with @type set to borrowing) containing a single <cit> for the one etymon to be described. This etymon, in turn, is associated with a language, a form, a bibliographical description, a cross-reference to another entry and a note 12 .
opalina.xml 12 Along with these components forming the core of the etymology of opalina, we can see how additional elements for marking-up labels and punctuation marks allow us to retain the linear flow of the original text. Listing 1: TEI encoding of the etymology for the opalina entry.
Listing 2: TEI encoding of the etymology for the sapato entry.

Conclusions
Our main goal in this article has been to demonstrate the use and utility of these two new parts of LMF and to communicate the particular approach to etymological modelling which we have taken to the language resources community. This work presented in this paper is part of a broader experiment consisting of the analysis and conversion of different, heterogeneous, Portuguese lexical resources including legacy dictionaries such as the DLPC and Houaiss into computational formats such as TEI which is currently in progress. Our intention in future work is to compare different TEI based approaches, and in particular TEI Lex-0 (a streamlined version of the TEI standard for dictionaries) and LMF-in-TEI, to see which is more suited to different kinds of lexicographic resources. On the LMF side, we intend to continue building on the core model established for Part 3 and described in this article by taking into consideration a large number of diverse and wide-ranging case studies while further elaborating, in tandem, on the TEI serialisation of the other parts of LMF.