Browse files

clean up of unused code

  • Loading branch information...
1 parent 1c127a6 commit d53e907bef69bc20552200f8d2b22101564c19bb @burningTyger committed Mar 20, 2012
Showing with 2 additions and 15 deletions.
  1. +2 −15 txt2mongo.rb
View
17 txt2mongo.rb
@@ -32,8 +32,7 @@ class Lemma
include MongoMapper::Document
enable_versioning :limit => 0
key :lemma, String, :unique => true, :required => true
- key :edited_by, String
- key :valid, Boolean
+ key :valid, Boolean, :default => true
key :language, String
many :translations
timestamps!
@@ -43,24 +42,11 @@ class Translation
include MongoMapper::EmbeddedDocument
key :source, String
key :target, String
- key :language, String
- key :fix, Boolean
- timestamps!
end
Lemma.collection.remove
Lemma.ensure_index(:lemma)
- #replace wasla with madda on alif
- def fix_typos(str)
- puts "Wasla to Madda in #{str} fixed" if str.gsub!("\u0671", "\u0622")
- end
-
- #this method removes kasra, fatha and damma from lemma
- def devowelize(str)
- str.delete("\u064B-\u0655")
- end
-
def strip_replace(str)
str.strip.gsub('\;', ';')
end
@@ -92,6 +78,7 @@ def strip_replace(str)
lemma.translations << trans
end
end
+ lemma.save
end
end

0 comments on commit d53e907

Please sign in to comment.