Class: NHKore::TinySplitter

Inherits:
Splitter show all
Defined in:
lib/nhkore/splitter.rb

Overview

Since:

  • 0.2.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Splitter

#begin_split, #split

Constructor Details

#initializeTinySplitter

Returns a new instance of TinySplitter.

Since:

  • 0.2.0



64
65
66
67
68
69
70
# File 'lib/nhkore/splitter.rb', line 64

def initialize(*)
  require 'tiny_segmenter'

  super

  @tiny = TinySegmenter.new
end

Instance Attribute Details

#tinyObject

Since:

  • 0.2.0



62
63
64
# File 'lib/nhkore/splitter.rb', line 62

def tiny
  @tiny
end

Instance Method Details

#end_split(str) ⇒ Object

Since:

  • 0.2.0



72
73
74
# File 'lib/nhkore/splitter.rb', line 72

def end_split(str)
  return @tiny.segment(str,ignore_punctuation: true)
end