Changeset 240
- Timestamp:
- 04/24/08 07:03:53 (7 months ago)
- Files:
-
- branches/yet_another_index_structure/lib/picolena/templates/app/helpers/documents_helper.rb (modified) (1 diff)
- branches/yet_another_index_structure/lib/picolena/templates/app/models/document.rb (modified) (1 diff)
- branches/yet_another_index_structure/lib/picolena/templates/spec/models/finder_spec.rb (modified) (1 diff)
- branches/yet_another_index_structure/lib/picolena/templates/spec/models/plain_text_extractor_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/yet_another_index_structure/lib/picolena/templates/app/helpers/documents_helper.rb
r228 r240 39 39 40 40 def language_icon_for(document) 41 (lang=document.lang ) && image_tag("flags/#{lang}.png")41 (lang=document.language) && image_tag("flags/#{lang}.png") 42 42 end 43 43 branches/yet_another_index_structure/lib/picolena/templates/app/models/document.rb
r239 r240 80 80 81 81 # Returns language. 82 def lang 82 def language 83 83 from_index[:language] 84 84 end branches/yet_another_index_structure/lib/picolena/templates/spec/models/finder_spec.rb
r239 r240 50 50 index=Indexer.index 51 51 index.field_infos[:basename].boost.should > 1.0 52 index.field_infos[:file ].boost.should > 1.052 index.field_infos[:filename].boost.should > 1.0 53 53 index.field_infos[:filetype].boost.should > 1.0 54 54 end branches/yet_another_index_structure/lib/picolena/templates/spec/models/plain_text_extractor_spec.rb
r238 r240 30 30 31 31 it "should guess language when enough content is available" do 32 Document.new("spec/test_dirs/indexed/lang/goethe").lang .should == "de"33 Document.new("spec/test_dirs/indexed/lang/shakespeare").lang .should == "en"34 Document.new("spec/test_dirs/indexed/lang/lorca").lang .should == "es"35 Document.new("spec/test_dirs/indexed/lang/hugo").lang .should == "fr"32 Document.new("spec/test_dirs/indexed/lang/goethe").language.should == "de" 33 Document.new("spec/test_dirs/indexed/lang/shakespeare").language.should == "en" 34 Document.new("spec/test_dirs/indexed/lang/lorca").language.should == "es" 35 Document.new("spec/test_dirs/indexed/lang/hugo").language.should == "fr" 36 36 end 37 37 38 38 it "should not try to guess language when file is too small" do 39 Document.new("spec/test_dirs/indexed/basic/hello.rb").lang .should be_empty40 Document.new("spec/test_dirs/indexed/README").lang .should be_empty39 Document.new("spec/test_dirs/indexed/basic/hello.rb").language.should be_empty 40 Document.new("spec/test_dirs/indexed/README").language.should be_empty 41 41 end 42 42 end
