Permalink
Browse files

changed Semantic:: references to RSemantic::

  • Loading branch information...
1 parent dd4cda6 commit d94f3ef5fe7eb41bcca055a40f2a98d37163c3d5 @todorus todorus committed Nov 27, 2013
View
6 lib/rsemantic/corpus.rb
@@ -30,22 +30,22 @@ def add_document(document)
#
# @return [void]
def build_index
- @search = Semantic::Search.new(@documents.map(&:text), @options)
+ @search = RSemantic::Search.new(@documents.map(&:text), @options)
end
def search(*words)
# TODO raise if no index built yet
results = @search.search(words)
results.map.with_index { |result, index|
document = @documents[index]
- Semantic::SearchResult.new(document, result)
+ RSemantic::SearchResult.new(document, result)
}.sort
end
def find_related_document(document)
@search.related(@documents.index(document)).map.with_index { |result, index|
document = @documents[index]
- Semantic::SearchResult.new(document, result)
+ RSemantic::SearchResult.new(document, result)
}.sort
end
View
2 lib/rsemantic/matrix_transformer.rb
@@ -8,7 +8,7 @@ def initialize(transforms)
def apply_transforms(vector_space_model)
@transforms.each do |transform|
begin
- transform_class = Semantic::Transform.const_get(transform)
+ transform_class = RSemantic::Transform.const_get(transform)
Semantic.logger.info("Applying #{transform} transform")
transform_class.transform!(vector_space_model.matrix)
Semantic.logger.info(vector_space_model)
View
2 rsemantic.gemspec
@@ -3,7 +3,7 @@ require "rsemantic/version"
Gem::Specification.new do |s|
s.name = %q{rsemantic}
- s.version = Semantic::VERSION::STRING
+ s.version = RSemantic::VERSION::STRING
s.platform = Gem::Platform::RUBY
s.license = "MIT"
s.homepage = %q{http://github.com/josephwilk/rsemantic}
View
2 spec/bugs_spec.rb
@@ -6,7 +6,7 @@
"A cat is a fine pet ponies.",
"Do and cats make good pets.",
"I haven't got a cat."]
- @search = Semantic::Search.new(documents)
+ @search = RSemantic::Search.new(documents)
end
describe "finding the related document weightings" do
View
6 spec_integration/semantic_spec.rb
@@ -8,15 +8,15 @@
"I haven't got a hat."]
#Log to stdout how the matrix gets built and transformed
- search = Semantic::Search.new(documents, :verbose => true)
+ search = RSemantic::Search.new(documents, :verbose => true)
#We can pass different transforms to be performed.
#Currently only :LSA and :TFIDF.
#The order of transforms reflects the order they will be performed on the matrix
- # search = Semantic::Search.new(documents, :transforms => [:LSA])
+ # search = RSemantic::Search.new(documents, :transforms => [:LSA])
#Defaults to performing :TFIDF and then :LSA
- # search = Semantic::Search.new(documents)
+ # search = RSemantic::Search.new(documents)
#Find documents that are related to documents[0] with a ranking for how related they are.
puts search.related(0)

0 comments on commit d94f3ef

Please sign in to comment.