Python LMF library
 All Classes Namespaces Files Functions Variables
sense.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 
3 """! @package core
4 """
5 
6 from core.definition import Definition
7 from morphosyntax.paradigm import Paradigm
8 from mrd.context import Context
9 from mrd.subject_field import SubjectField
10 from mrd.equivalent import Equivalent
11 
12 class Sense():
13  """! "Sense is a class representing one meaning of a lexical entry. The Sense class allows for hierarchical senses in that a sense may be more specific than another sense of the same lexical entry." (LMF)
14  """
15  def __init__(self, id=0):
16  """! @brief Constructor.
17  Sense instances are owned by LexicalEntry.
18  @param id IDentifier. If not provided, default value is 0.
19  @return A Sense instance.
20  """
21  self.senseNumber = None
22  # ID is managed at the LexicalEntry level
23  self.id = id
24  ## Definition instances are owned by Sense
25  # There is zero to many Definition instances per Sense
26  self.definition = []
27  ## Sense instances are owned by Sense
28  # There is zero to many Sense instances per Sense
29  self.sense = []
30  ## Equivalent instances are owned by Sense
31  # There is zero to many Equivalent instances per Sense
32  self.equivalent = []
33  ## Context instances are owned by Sense
34  # There is zero to many Context instances per Sense
35  self.context = []
36  ## SubjectField instances are owned by Sense
37  # There is zero to many SubjectField instances per Sense
38  self.subject_field = []
39  ## Paradigm instances are owned by Sense
40  # There is zero to many Paradigm instances per Sense
41  self.paradigm = []
42 
43  def __del__(self):
44  """! @brief Destructor.
45  Release Definition, Sense, Equivalent, Context, SubjectField, Paradigm instances.
46  """
47  for definition in self.definition:
48  del definition
49  del self.definition[:]
50  for sense in self.sense:
51  del sense
52  del self.sense[:]
53  for equivalent in self.equivalent:
54  del equivalent
55  del self.equivalent[:]
56  for context in self.context:
57  del context
58  del self.context[:]
59  for subject_field in self.subject_field:
60  del subject_field
61  del self.subject_field[:]
62  for paradigm in self.paradigm:
63  del paradigm
64  del self.paradigm[:]
65 
66  def get_id(self):
67  """! @brief IDentifier.
68  @return Sense attribute 'id'.
69  """
70  return self.id
71 
72  def set_senseNumber(self, sense_number):
73  """! @brief Set sense number.
74  @param sense_number The sense number to set.
75  @return Sense instance.
76  """
77  self.senseNumber = sense_number
78  return self
79 
80  def get_senseNumber(self, integer=False):
81  """! @brief Get sense number.
82  @integer If True, return a numerical value.
83  @return Sense attribute 'senseNumber'.
84  """
85  if not integer:
86  return self.senseNumber
87  if self.senseNumber is None:
88  return 0
89  return int(self.senseNumber)
90 
91  def create_definition(self):
92  """! @brief Create a definition.
93  @return Definition instance.
94  """
95  return Definition()
96 
97  def add_definition(self, definition):
98  """! @brief Add a definition to the sense.
99  @param definition The Definition instance to add to the sense.
100  @return Sense instance.
101  """
102  self.definition.append(definition)
103  return self
104 
105  def get_definitions(self):
106  """! @brief Get all definitions maintained by the sense.
107  @return A Python list of definitions.
108  """
109  return self.definition
110 
112  """! @brief Get the previously registered Definition instance.
113  @return The last element of Sense attribute 'definition'.
114  """
115  if len(self.get_definitions()) >= 1:
116  return self.get_definitions()[-1]
117 
118  def find_definitions(self, language):
119  """! @brief Find definitions.
120  This attribute is owned by Definition.
121  @param language The language to consider to retrieve the definition.
122  @return A Python list of found Definition attributes 'definition'.
123  """
124  found_definitions = []
125  for definition in self.get_definitions():
126  if definition.get_language() == language and definition.get_definition() is not None:
127  found_definitions.append(definition.get_definition())
128  return found_definitions
129 
130  def set_definition(self, definition, language=None):
131  """! @brief Set definition and language.
132  These attributes are owned by Definition.
133  @param definition Definition.
134  @param language Language of definition.
135  @return Sense instance.
136  """
137  instance = None
138  # Find if there is a Definition instance with this language without definition
139  for inst in self.get_definitions():
140  if inst.get_language() == language and inst.get_definition() is None:
141  # Found the Definition instance to set
142  instance = inst
143  break
144  if instance is None:
145  # Set first Definition instance that has no definition nor language
146  for inst in self.get_definitions():
147  if inst.get_language() is None and inst.get_definition() is None:
148  # Found the Definition instance to set
149  instance = inst
150  break
151  if instance is None:
152  # Create a Definition instance
153  instance = self.create_definition()
154  self.add_definition(instance)
155  instance.set_definition(definition, language)
156  return self
157 
158  def find_glosses(self, language):
159  """! @brief Find glosses.
160  This attribute is owned by Definition.
161  @param language The language to consider to retrieve the gloss.
162  @return A Python list of found Definition attributes 'gloss'.
163  """
164  found_glosses = []
165  for definition in self.get_definitions():
166  if definition.get_language() == language and definition.get_gloss() is not None:
167  found_glosses.append(definition.get_gloss())
168  return found_glosses
169 
170  def set_gloss(self, gloss, language=None):
171  """! @brief Set gloss and language.
172  These attributes are owned by Definition.
173  @param gloss Gloss.
174  @param language Language of gloss.
175  @return Sense instance.
176  """
177  instance = None
178  # Find if there is a Definition instance with this language without gloss
179  for inst in self.get_definitions():
180  if inst.get_language() == language and inst.get_gloss() is None:
181  # Found the Definition instance to set
182  instance = inst
183  break
184  if instance is None:
185  # Set first Definition instance that has no gloss nor language
186  for inst in self.get_definitions():
187  if inst.get_language() is None and inst.get_gloss() is None:
188  # Found the Definition instance to set
189  instance = inst
190  break
191  if instance is None:
192  # Create a Definition instance
193  instance = self.create_definition()
194  self.add_definition(instance)
195  instance.set_gloss(gloss, language)
196  return self
197 
198  def set_note(self, note, type=None, language=None):
199  """! @brief Set note, note type and language.
200  These attributes are owned by Statement, which is owned by Definition.
201  @param note Note to set.
202  @param type Type of the note.
203  @param language Language used for the note.
204  @return Sense instance.
205  """
206  # Get the last Definition instance if any
207  definition = self.get_last_definition()
208  # If there is no Definition instances, create and add one
209  if definition is None:
210  definition = self.create_definition()
211  self.add_definition(definition)
212  definition.set_note(note, type, language)
213  return self
214 
215  def find_notes(self, type, language=None):
216  """! @brief Find notes.
217  This attribute is owned by Statement, which owned by Definition.
218  @param type Type of the note to consider to retrieve the note.
219  @param language If this argument is given, find note only if written in this language.
220  @return A Python list of found Statement attributes 'notes'.
221  """
222  found_notes = []
223  for definition in self.get_definitions():
224  found_notes += definition.find_notes(type, language)
225  return found_notes
226 
227  def set_usage_note(self, usage_note, language=None):
228  """! @brief Set usage note and language.
229  These attributes are owned by Statement, which is owned by Definition.
230  @param usage_note Usage note to set.
231  @param language Language used for the usage note.
232  @return Sense instance.
233  """
234  # Get the last Definition instance if any
235  definition = self.get_last_definition()
236  # If there is no Definition instances, create and add one
237  if definition is None:
238  definition = self.create_definition()
239  self.add_definition(definition)
240  definition.set_usage_note(usage_note, language)
241  return self
242 
243  def find_usage_notes(self, language):
244  """! @brief Find usage notes.
245  This attribute is owned by Statement, which owned by Definition.
246  @param language Language to consider to retrieve the usage note.
247  @return A Python list of found Statement attributes 'usageNote'.
248  """
249  found_notes = []
250  for definition in self.get_definitions():
251  found_notes += definition.find_usage_notes(language)
252  return found_notes
253 
254  def set_encyclopedic_information(self, encyclopedic_information, language=None):
255  """! @brief Set encyclopedic information and language.
256  These attributes are owned by Statement, which is owned by Definition.
257  @param encyclopedic_information Encyclopedic information to set.
258  @param language Language used for the encyclopedic information.
259  @return Sense instance.
260  """
261  # Get the last Definition instance if any
262  definition = self.get_last_definition()
263  # If there is no Definition instances, create and add one
264  if definition is None:
265  definition = self.create_definition()
266  self.add_definition(definition)
267  definition.set_encyclopedic_information(encyclopedic_information, language)
268  return self
269 
270  def find_encyclopedic_informations(self, language):
271  """! @brief Find encyclopedic informations.
272  This attribute is owned by Statement, which owned by Definition.
273  @param language Language to consider to retrieve the encyclopedic informations.
274  @return A Python list of found Statement attributes 'encyclopedicInformation'.
275  """
276  found_informations = []
277  for definition in self.get_definitions():
278  found_informations += definition.find_encyclopedic_informations(language)
279  return found_informations
280 
281  def set_restriction(self, restriction, language=None):
282  """! @brief Set restriction and language.
283  These attributes are owned by Statement, which is owned by Definition.
284  @param restriction Restriction to set.
285  @param language Language used for the restriction.
286  @return Sense instance.
287  """
288  # Get the last Definition instance if any
289  definition = self.get_last_definition()
290  # If there is no Definition instances, create and add one
291  if definition is None:
292  definition = self.create_definition()
293  self.add_definition(definition)
294  definition.set_restriction(restriction, language)
295  return self
296 
297  def find_restrictions(self, language):
298  """! @brief Find restrictions.
299  This attribute is owned by Statement, which owned by Definition.
300  @param language Language to consider to retrieve the restriction.
301  @return A Python list of found Statement attributes 'restriction'.
302  """
303  found_restrictions = []
304  for definition in self.get_definitions():
305  found_restrictions += definition.find_restrictions(language)
306  return found_restrictions
307 
308  def set_borrowed_word(self, borrowed_word):
309  """! @brief Set source language (in English).
310  Attribute 'borrowedWord' is owned by Statement, which is owned by Definition.
311  @param borrowed_word Source language.
312  @return Sense instance.
313  """
314  # Get the last Definition instance if any
315  definition = self.get_last_definition()
316  # If there is no Definition instance, create and add one
317  if definition is None:
318  definition = self.create_definition()
319  self.add_definition(definition)
320  definition.set_borrowed_word(borrowed_word)
321  return self
322 
323  def get_borrowed_word(self):
324  """! @brief Get source language (in English).
325  This attribute is owned by Statement, which is owned by Definition.
326  @return Statement attribute 'borrowedWord'.
327  """
328  for definition in self.get_definitions():
329  if definition.get_borrowed_word() is not None:
330  # Get borrowed word if any
331  return definition.get_borrowed_word()
332 
333  def set_written_form(self, written_form):
334  """! @brief Set loan word.
335  Attribute 'writtenForm' is owned by Statement, which is owned by Definition.
336  @param written_form Loan word.
337  @return Sense instance.
338  """
339  # Get the last Definition instance if any
340  definition = self.get_last_definition()
341  # If there is no Definition instance, create and add one
342  if definition is None:
343  definition = self.create_definition()
344  self.add_definition(definition)
345  definition.set_written_form(written_form)
346  return self
347 
348  def get_written_form(self):
349  """! @brief Get loan word.
350  This attribute is owned by Statement, which is owned by Definition.
351  @return Statement attribute 'writtenForm'.
352  """
353  for definition in self.get_definitions():
354  if definition.get_written_form() is not None:
355  # Get loan word if any
356  return definition.get_written_form()
357 
358  def set_etymology(self, etymology):
359  """! @brief Set etymology.
360  Attribute 'etymology' is owned by Statement, which is owned by Definition.
361  @param etymology Etymology.
362  @return Sense instance.
363  """
364  # Get the last Definition instance if any
365  definition = self.get_last_definition()
366  # If there is no Definition instance, create and add one
367  if definition is None:
368  definition = self.create_definition()
369  self.add_definition(definition)
370  definition.set_etymology(etymology)
371  return self
372 
373  def get_etymology(self):
374  """! @brief Get etymology.
375  This attribute is owned by Statement, which is owned by Definition.
376  @return The first found Statement attribute 'etymology'.
377  """
378  for definition in self.get_definitions():
379  if definition.get_etymology() is not None:
380  return definition.get_etymology()
381 
382  def set_etymology_comment(self, etymology_comment, term_source_language=None):
383  """! @brief Set etymology comment and language.
384  Attributes 'etymologyComment' and 'termSourceLanguage' are owned by Statement, which is owned by Definition.
385  @param etymology_comment Etymology comment.
386  @param term_source_language Language of the comment.
387  @return Sense instance.
388  """
389  # Get the last Definition instance if any
390  definition = self.get_last_definition()
391  # If there is no Definition instance, create and add one
392  if definition is None:
393  definition = self.create_definition()
394  self.add_definition(definition)
395  definition.set_etymology_comment(etymology_comment, term_source_language)
396  return self
397 
398  def get_etymology_comment(self, term_source_language=None):
399  """! @brief Get etymology comment.
400  This attribute is owned by Statement, which is owned by Definition.
401  @param term_source_language The language of the etymology comment to retrieve.
402  @return The first found Statement attribute 'etymologyComment'.
403  """
404  for definition in self.get_definitions():
405  if definition.get_etymology_comment(term_source_language) is not None:
406  return definition.get_etymology_comment(term_source_language)
407 
409  """! @brief Get language used for the etymology comment.
410  This attribute is owned by Statement, which is owned by Definition.
411  @return Statement attribute 'termSourceLanguage'.
412  """
413  # Get the last Definition instance if any
414  definition = self.get_last_definition()
415  # If there is a Definition instance, get etymology comment language
416  if definition is not None:
417  return definition.get_term_source_language()
418 
419  def set_etymology_gloss(self, etymology_gloss):
420  """! @brief Set etymology gloss.
421  Attribute 'etymologyGloss' is owned by Statement, which is owned by Definition.
422  @param etymology_gloss Etymology gloss.
423  @return Sense instance.
424  """
425  # Get the last Definition instance if any
426  definition = self.get_last_definition()
427  # If there is no Definition instance, create and add one
428  if definition is None:
429  definition = self.create_definition()
430  self.add_definition(definition)
431  definition.set_etymology_gloss(etymology_gloss)
432  return self
433 
435  """! @brief Get etymology gloss.
436  This attribute is owned by Statement, which is owned by Definition.
437  @return Statement attribute 'etymologyGloss'.
438  """
439  # Get the last Definition instance if any
440  definition = self.get_last_definition()
441  # If there is a Definition instance, get etymology gloss
442  if definition is not None:
443  return definition.get_etymology_gloss()
444 
445  def set_etymology_source(self, etymology_source):
446  """! @brief Set etymology source.
447  Attribute 'etymologySource' is owned by Statement, which is owned by Definition.
448  @param etymology_source Etymology source.
449  @return Sense instance.
450  """
451  # Get the last Definition instance if any
452  definition = self.get_last_definition()
453  # If there is no Definition instance, create and add one
454  if definition is None:
455  definition = self.create_definition()
456  self.add_definition(definition)
457  definition.set_etymology_source(etymology_source)
458  return self
459 
461  """! @brief Get etymology source.
462  This attribute is owned by Statement, which is owned by Definition.
463  @return Statement attribute 'etymologySource'.
464  """
465  # Get the last Definition instance if any
466  definition = self.get_last_definition()
467  # If there is a Definition instance, get etymology source
468  if definition is not None:
469  return definition.get_etymology_source()
470 
471  def set_scientific_name(self, scientific_name):
472  """! @brief Set scientific name.
473  Attribute 'scientificName' is owned by Statement, which is owned by Definition.
474  @param scientific_name Scientific name.
475  @return Sense instance.
476  """
477  # Get the last Definition instance if any
478  definition = self.get_last_definition()
479  # If there is no Definition instance, create and add one
480  if definition is None:
481  definition = self.create_definition()
482  self.add_definition(definition)
483  definition.set_scientific_name(scientific_name)
484  return self
485 
487  """! @brief Get scientific name.
488  This attribute is owned by Statement, which is owned by Definition.
489  @return Statement attribute 'scientificName'.
490  """
491  # Get the last Definition instance if any
492  definition = self.get_last_definition()
493  # If there is a Definition instance, get scientific name
494  if definition is not None:
495  return definition.get_scientific_name()
496 
497  def create_paradigm(self):
498  """! @brief Create a paradigm.
499  @return Paradigm instance.
500  """
501  return Paradigm()
502 
503  def add_paradigm(self, paradigm):
504  """! @brief Add a paradigm to the sense.
505  @param paradigm The Paradigm instance to add to the sense.
506  @return Sense instance.
507  """
508  self.paradigm.append(paradigm)
509  return self
510 
511  def get_paradigms(self):
512  """! @brief Get all paradigms maintained by the sense.
513  @return A Python list of paradigms.
514  """
515  return self.paradigm
516 
517  def get_last_paradigm(self):
518  """! @brief Get the previously registered Paradigm instance.
519  @return The last element of Sense attribute 'paradigm'.
520  """
521  if len(self.get_paradigms()) >= 1:
522  return self.get_paradigms()[-1]
523 
524  def set_paradigm_label(self, paradigm_label):
525  """! @brief Set paradigm label.
526  Attribute 'paradigmLabel' is owned by Paradigm.
527  @param paradigm_label Paradigm label.
528  @return Sense instance.
529  """
530  # Create a paradigm instance, set it, and add it to the list
531  self.add_paradigm(self.create_paradigm().set_paradigmLabel(paradigm_label))
532  return self
533 
534  def set_paradigm_form(self, paradigm_form, language=None):
535  """! @brief Set paradigm form and language.
536  Attributes 'paradigm' and 'language' are owned by Paradigm.
537  @param paradigm_form Paradigm form.
538  @param language Language used for the paradigm form.
539  @return Sense instance.
540  """
541  paradigm_label = None
542  # Get the last Paradigm instance if any
543  paradigm = self.get_last_paradigm()
544  # If there is a Paradigm instance, check if the paradigm form or language are already set
545  if paradigm is not None:
546  # Save the paradigm label
547  paradigm_label = paradigm.get_paradigmLabel()
548  if paradigm.get_paradigm() is not None or (paradigm.get_language() is not None and paradigm.get_language() != language):
549  # A new paradigm instance has to be created
550  paradigm = None
551  if paradigm is None:
552  # Create a paradigm instance and add it to the list
553  paradigm = self.create_paradigm()
554  self.add_paradigm(paradigm)
555  paradigm.set_paradigm(paradigm_form)
556  if language is not None:
557  paradigm.set_language(language)
558  # Report previous paradigm label if needed
559  if paradigm_label is not None and paradigm.get_paradigmLabel() is None:
560  paradigm.set_paradigmLabel(paradigm_label)
561  return self
562 
563  def set_morphology(self, morphology):
564  """! @brief Set morphology.
565  Attribute 'morphology' is owned by Paradigm.
566  @param morphology Morphology.
567  @return Sense instance.
568  """
569  paradigm = None
570  # Get the first Paradigm instance that has no morphology
571  for item in self.get_paradigms():
572  if item.get_morphology() is None:
573  paradigm = item
574  break
575  if paradigm is None:
576  # Create a paradigm instance and add it to the list
577  paradigm = self.create_paradigm()
578  self.add_paradigm(paradigm)
579  paradigm.set_morphology(morphology)
580  return self
581 
582  def create_and_add_context(self, reference=None):
583  """! @brief Create a context and add it to the list.
584  @param reference The context reference to set. If not provided, default value is None.
585  @return Context instance.
586  """
587  context = Context(reference)
588  self.context.append(context)
589  return context
590 
591  def get_contexts(self):
592  """! @brief Get all contexts maintained by the sense.
593  @return A Python list of contexts.
594  """
595  return self.context
596 
597  def get_last_context(self):
598  """! @brief Get the previously registered Context instance.
599  @return The last element of Sense attribute 'context'.
600  """
601  if len(self.get_contexts()) >= 1:
602  return self.get_contexts()[-1]
603 
604  def create_example(self, reference=None):
605  """! @brief Create a Context instance and set its reference.
606  Attribute 'targets' is owned by Context.
607  @param reference The example reference to set. If not provided, default value is None.
608  @return Sense instance.
609  """
610  self.create_and_add_context(reference).set_type("example")
611  return self
612 
613  def create_and_add_example(self, written_form, language=None, script_name=None):
614  """! @brief Set written form, language and script of a new Context instance.
615  Attributes 'writtenForm', 'language' and 'scriptName' are owned by TextRepresentation, which is owned by Context.
616  @param written_form The written form to set.
617  @param language Language used for the written form.
618  @param script_name The name of the script used to write the example, e.g. devanagari.
619  @return Sense instance.
620  """
621  # Get the last Context instance if any
622  context = self.get_last_context()
623  # If there is no Context instance, create and add one
624  if context is None or len(context.get_text_representations()) != 0:
625  context = self.create_and_add_context().set_type("example")
626  context.set_written_form(written_form, language, script_name)
627  return self
628 
629  def add_example(self, written_form, language=None, script_name=None):
630  """! @brief Set written form, language and script of an existing Context instance.
631  Attributes 'writtenForm', 'language' and 'scriptName' are owned by TextRepresentation, which is owned by Context.
632  @param written_form The written form to set.
633  @param language Language used for the written form.
634  @param script_name The name of the script used to write the example, e.g. devanagari.
635  @return Sense instance.
636  """
637  # Get the last Context instance if any
638  context = self.get_last_context()
639  # If there is no Context instance, create and add one
640  if context is None:
641  context = self.create_and_add_context().set_type("example")
642  context.set_written_form(written_form, language, script_name)
643  return self
644 
645  def set_example_comment(self, comment):
646  """! @brief Set comment of an existing Context instance.
647  Attribute 'comment' is owned by TextRepresentation, which is owned by Context.
648  @param comment The comment to set.
649  @return Sense instance.
650  """
651  # Get the last Context instance if any
652  context = self.get_last_context()
653  # If there is no Context instance, create and add one
654  if context is None:
655  context = self.create_and_add_context().set_type("example")
656  context.set_comment(comment)
657  return self
658 
660  """! @brief Create a subject field and add it to the list.
661  @return SubjectField instance.
662  """
663  subject_field = SubjectField()
664  self.subject_field.append(subject_field)
665  return subject_field
666 
668  """! @brief Get all subject fields maintained by the sense.
669  @return A Python list of subject fields.
670  """
671  return self.subject_field
672 
673  def set_semantic_domain(self, semantic_domain, language=None):
674  """! @brief Create a SubjectField instance and set its semantic domain and language.
675  Attributes 'semanticDomain' and 'language' are owned by SubjectField.
676  @param semantic_domain The semantic domain to set.
677  @param language Language used to describe the semantic domain.
678  @return Sense instance.
679  """
680  self.create_and_add_subject_field().set_semanticDomain(semantic_domain, language)
681  return self
682 
684  """! @brief Create an equivalent and add it to the list.
685  @return Equivalent instance.
686  """
687  equivalent = Equivalent()
688  self.equivalent.append(equivalent)
689  return equivalent
690 
691  def get_equivalents(self):
692  """! @brief Get all equivalents maintained by the sense.
693  @return A Python list of equivalents.
694  """
695  return self.equivalent
696 
697  def set_translation(self, translation, language=None):
698  """! @brief Create an Equivalent instance and set its translation and language.
699  Attributes 'translation' and 'language' are owned by Equivalent.
700  @param translation The translation to set.
701  @param language Language used for the translation.
702  @return Sense instance.
703  """
704  self.create_and_add_equivalent().set_translation(translation, language)
705  return self
706 
707  def get_translations(self, language=None):
708  """! @brief Get all translations.
709  This attribute is owned by Equivalent.
710  @param language If this argument is given, get only translations that are described using this language.
711  @return A Python list of filtered Equivalent attributes 'translation'.
712  """
713  translations = []
714  for equivalent in self.get_equivalents():
715  if equivalent.get_translation(language) is not None:
716  translations.append(equivalent.get_translation(language))
717  return translations
paradigm
Paradigm instances are owned by Sense There is zero to many Paradigm instances per Sense...
Definition: sense.py:41
def set_morphology
Set morphology.
Definition: sense.py:563
def get_last_paradigm
Get the previously registered Paradigm instance.
Definition: sense.py:517
def set_etymology_comment
Set etymology comment and language.
Definition: sense.py:382
definition
Definition instances are owned by Sense There is zero to many Definition instances per Sense...
Definition: sense.py:26
def set_paradigm_label
Set paradigm label.
Definition: sense.py:524
def add_paradigm
Add a paradigm to the sense.
Definition: sense.py:503
def set_example_comment
Set comment of an existing Context instance.
Definition: sense.py:645
def set_etymology
Set etymology.
Definition: sense.py:358
def get_paradigms
Get all paradigms maintained by the sense.
Definition: sense.py:511
def set_gloss
Set gloss and language.
Definition: sense.py:170
def find_notes
Find notes.
Definition: sense.py:215
def get_translations
Get all translations.
Definition: sense.py:707
def set_restriction
Set restriction and language.
Definition: sense.py:281
def set_usage_note
Set usage note and language.
Definition: sense.py:227
def __init__
Constructor.
Definition: sense.py:15
def get_scientific_name
Get scientific name.
Definition: sense.py:486
def get_etymology_gloss
Get etymology gloss.
Definition: sense.py:434
def find_definitions
Find definitions.
Definition: sense.py:118
def get_etymology_source
Get etymology source.
Definition: sense.py:460
def create_and_add_context
Create a context and add it to the list.
Definition: sense.py:582
def get_senseNumber
Get sense number.
Definition: sense.py:80
def add_definition
Add a definition to the sense.
Definition: sense.py:97
def find_encyclopedic_informations
Find encyclopedic informations.
Definition: sense.py:270
def create_and_add_subject_field
Create a subject field and add it to the list.
Definition: sense.py:659
def set_etymology_source
Set etymology source.
Definition: sense.py:445
def set_definition
Set definition and language.
Definition: sense.py:130
def get_contexts
Get all contexts maintained by the sense.
Definition: sense.py:591
def get_written_form
Get loan word.
Definition: sense.py:348
equivalent
Equivalent instances are owned by Sense There is zero to many Equivalent instances per Sense...
Definition: sense.py:32
"Sense is a class representing one meaning of a lexical entry. The Sense class allows for hierarchica...
Definition: sense.py:12
def create_and_add_example
Set written form, language and script of a new Context instance.
Definition: sense.py:613
def get_definitions
Get all definitions maintained by the sense.
Definition: sense.py:105
def get_last_context
Get the previously registered Context instance.
Definition: sense.py:597
def set_note
Set note, note type and language.
Definition: sense.py:198
def set_etymology_gloss
Set etymology gloss.
Definition: sense.py:419
def find_usage_notes
Find usage notes.
Definition: sense.py:243
def get_etymology
Get etymology.
Definition: sense.py:373
def get_subject_fields
Get all subject fields maintained by the sense.
Definition: sense.py:667
def set_semantic_domain
Create a SubjectField instance and set its semantic domain and language.
Definition: sense.py:673
def get_term_source_language
Get language used for the etymology comment.
Definition: sense.py:408
def find_restrictions
Find restrictions.
Definition: sense.py:297
subject_field
SubjectField instances are owned by Sense There is zero to many SubjectField instances per Sense...
Definition: sense.py:38
sense
Sense instances are owned by Sense There is zero to many Sense instances per Sense.
Definition: sense.py:29
def set_paradigm_form
Set paradigm form and language.
Definition: sense.py:534
def create_paradigm
Create a paradigm.
Definition: sense.py:497
def set_written_form
Set loan word.
Definition: sense.py:333
context
Context instances are owned by Sense There is zero to many Context instances per Sense.
Definition: sense.py:35
def create_definition
Create a definition.
Definition: sense.py:91
def add_example
Set written form, language and script of an existing Context instance.
Definition: sense.py:629
def set_borrowed_word
Set source language (in English).
Definition: sense.py:308
def find_glosses
Find glosses.
Definition: sense.py:158
def create_example
Create a Context instance and set its reference.
Definition: sense.py:604
def set_encyclopedic_information
Set encyclopedic information and language.
Definition: sense.py:254
def set_translation
Create an Equivalent instance and set its translation and language.
Definition: sense.py:697
def get_borrowed_word
Get source language (in English).
Definition: sense.py:323
def set_scientific_name
Set scientific name.
Definition: sense.py:471
def get_equivalents
Get all equivalents maintained by the sense.
Definition: sense.py:691
def get_last_definition
Get the previously registered Definition instance.
Definition: sense.py:111
def get_etymology_comment
Get etymology comment.
Definition: sense.py:398
def set_senseNumber
Set sense number.
Definition: sense.py:72
def create_and_add_equivalent
Create an equivalent and add it to the list.
Definition: sense.py:683