Class: RubyPager::Text_Line

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_pager/text_line.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ex_index, ex_data) ⇒ Text_Line

Returns a new instance of Text_Line.



6
7
8
9
10
11
12
13
# File 'lib/ruby_pager/text_line.rb', line 6

def initialize(ex_index, ex_data)
  @data=ex_data
  @index=ex_index
  @id = @data["@id"]
  @text = @data["TextEquiv"]["Unicode"]
  load_coords()
  load_baseline()
end

Instance Attribute Details

#baselineObject (readonly)

Returns the value of attribute baseline.



5
6
7
# File 'lib/ruby_pager/text_line.rb', line 5

def baseline
  @baseline
end

#contourObject (readonly)

Returns the value of attribute contour.



5
6
7
# File 'lib/ruby_pager/text_line.rb', line 5

def contour
  @contour
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/ruby_pager/text_line.rb', line 5

def id
  @id
end

#indexObject

Returns the value of attribute index.



5
6
7
# File 'lib/ruby_pager/text_line.rb', line 5

def index
  @index
end

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/ruby_pager/text_line.rb', line 5

def text
  @text
end

Class Method Details

.blankObject



15
16
17
# File 'lib/ruby_pager/text_line.rb', line 15

def self.blank
  return Text_Line.new(0,Text_Line.blank_data)
end

.blank_dataObject



43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ruby_pager/text_line.rb', line 43

def self.blank_data
  res=Hash.new
  res["@id"]=""
  res["TextEquiv"]=Hash.new
  res["TextEquiv"]["Unicode"]=""
  res["Baseline"]=Hash.new
  res["Baseline"]["@points"]=Coords.blank_data
  res["Coords"]=Hash.new
  res["Coords"]["@points"]=Coords.blank_data
  return res
end

Instance Method Details

#baseline_vertical_noise(ex_std_dev) ⇒ Object



39
40
41
# File 'lib/ruby_pager/text_line.rb', line 39

def baseline_vertical_noise(ex_std_dev)
  @baseline.vertical_noise(ex_std_dev)
end

#get_consolidated_dataObject



34
35
36
37
# File 'lib/ruby_pager/text_line.rb', line 34

def get_consolidated_data
  consolidate_data()
  return @data
end