Class: StringIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/vimamsa/file_finder.rb

Instance Method Summary collapse

Constructor Details

#initializeStringIndex

Returns a new instance of StringIndex.



9
10
11
# File 'lib/vimamsa/file_finder.rb', line 9

def initialize()
  @idx = StrIdx::StringIndex.new
end

Instance Method Details

#add(str, id) ⇒ Object



21
22
23
# File 'lib/vimamsa/file_finder.rb', line 21

def add(str, id)
  @idx.add(str, id)
end

#find(str, minChars: 2) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/vimamsa/file_finder.rb', line 13

def find(str, minChars: 2)
  minChars = 3 if minChars.class != Integer
  minChars = 2 if minChars < 2
  minChars = 6 if minChars > 6 #TODO: implement option in C++

  @idx.find(str)
end