Permalink
Browse files

Add Marshal support to RSemantic::Search

  • Loading branch information...
1 parent 94f2615 commit 91286391fd06f9d6af490a6035bbefc1a4ac782d @pepijn pepijn committed Mar 1, 2014
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/rsemantic/search.rb
View
@@ -41,5 +41,17 @@ def search(search_list)
end
ratings
end
+
+ private
+
+ def marshal_dump
+ [@builder, @matrix_transformer, @vector_space_model.to_a]
+ end
+
+ def marshal_load(array)
+ @builder = array.shift
+ @matrix_transformer = array.shift
+ @vector_space_model = GSL::Matrix.alloc(*array.shift)
+ end
end
end

0 comments on commit 9128639

Please sign in to comment.