Class: PROIEL::Lemma

Inherits:
TreebankObject show all
Defined in:
lib/proiel/lemma.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from TreebankObject

#inspect

Constructor Details

#initialize(parent, xml = nil) ⇒ Lemma

Creates a new lemma object.



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/proiel/lemma.rb', line 31

def initialize(parent, xml = nil)
  @dictionary = parent

  @n = nil

  @distribution = {}
  @homographs = []
  @glosses = {}
  @paradigm = {}
  @valency = []

  from_xml(xml) if xml
end

Instance Attribute Details

#dictionaryDictionary (readonly)

Returns source that the lemma belongs to.

Returns:

  • (Dictionary)

    source that the lemma belongs to



9
10
11
# File 'lib/proiel/lemma.rb', line 9

def dictionary
  @dictionary
end

#distributionHash{String, Integer} (readonly)

keys are IDs of sources, the values give the frequency of the lemma per source.

Returns:

  • (Hash{String, Integer})

    distribution of lemmata in sources. The



16
17
18
# File 'lib/proiel/lemma.rb', line 16

def distribution
  @distribution
end

#glossesHash{Symbol, String} (readonly)

are language tags and the values the glosses.

Returns:

  • (Hash{Symbol, String})

    glosses for the current lemma. The keys



26
27
28
# File 'lib/proiel/lemma.rb', line 26

def glosses
  @glosses
end

#homographsArray<[String, String]> identified homographs of this lemma. The (readonly)

array contains pairs of lemma form (which will be homographs of this lemma form under the orthographic conventions of the language) and parts of speech.

Returns:

  • (Array<[String, String]> identified homographs of this lemma. The)

    Array<[String, String]> identified homographs of this lemma. The



22
23
24
# File 'lib/proiel/lemma.rb', line 22

def homographs
  @homographs
end

#nObject (readonly)

Returns the value of attribute n.



11
12
13
# File 'lib/proiel/lemma.rb', line 11

def n
  @n
end

#paradigmObject (readonly)

Returns the value of attribute paradigm.



27
28
29
# File 'lib/proiel/lemma.rb', line 27

def paradigm
  @paradigm
end

#valencyObject (readonly)

Returns the value of attribute valency.



28
29
30
# File 'lib/proiel/lemma.rb', line 28

def valency
  @valency
end