some refactor in the index searcher
This commit is contained in:
parent
90a13feab4
commit
6c685b4840
|
@ -16,10 +16,11 @@ class Polecat
|
||||||
# IndexSearcher.new 'index_dir'
|
# IndexSearcher.new 'index_dir'
|
||||||
# IndexSearcher.new(IndexReader.new 'index_dir')
|
# IndexSearcher.new(IndexReader.new 'index_dir')
|
||||||
def initialize *args
|
def initialize *args
|
||||||
if args[0].class == Polecat::IndexReader
|
first = args[0]
|
||||||
@reader = args[0]
|
if first.class == Polecat::IndexReader
|
||||||
elsif args[0].class == String
|
@reader = first
|
||||||
@reader = Polecat::IndexReader.new args[0]
|
elsif first.class == String
|
||||||
|
@reader = Polecat::IndexReader.new first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue