Class: Oulipo::Analysis

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/oulipo/analysis.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, options = {}) ⇒ Analysis

Returns a new instance of Analysis.



7
8
9
10
11
# File 'lib/oulipo/analysis.rb', line 7

def initialize(text, options = {})
  @word_lists = options
  @original = text
  deconstruct!
end

Instance Attribute Details

#deconstructionObject (readonly)

Returns the value of attribute deconstruction.



5
6
7
# File 'lib/oulipo/analysis.rb', line 5

def deconstruction
  @deconstruction
end

#originalObject (readonly)

Returns the value of attribute original.



5
6
7
# File 'lib/oulipo/analysis.rb', line 5

def original
  @original
end

#word_listsObject (readonly)

Returns the value of attribute word_lists.



5
6
7
# File 'lib/oulipo/analysis.rb', line 5

def word_lists
  @word_lists
end

Instance Method Details

#identified(type = nil) ⇒ Object



13
14
15
16
17
# File 'lib/oulipo/analysis.rb', line 13

def identified(type = nil)
  result = identified_tuples
  result.select! { |tuple| tuple.last == type } if type
  result.map(&:first)
end