diff options
author | Ellen Spertus <ellen.spertus@gmail.com> | 2018-08-28 07:37:28 -0700 |
---|---|---|
committer | Ellen Spertus <ellen.spertus@gmail.com> | 2018-09-04 14:59:29 -0700 |
commit | fc2e349f2bdadf5e05734a9304d20a84d4b6d927 (patch) | |
tree | bb944e3829927d273097156bfad064cc3ecce8c8 /scalding/src/test/scala/sandcrawler/ScoreJobTest.scala | |
parent | 98f78c0ef17436f87991169b4a7bedadf602527a (diff) | |
download | sandcrawler-fc2e349f2bdadf5e05734a9304d20a84d4b6d927.tar.gz sandcrawler-fc2e349f2bdadf5e05734a9304d20a84d4b6d927.zip |
fixed tests after replacing NoSlug with None
Diffstat (limited to 'scalding/src/test/scala/sandcrawler/ScoreJobTest.scala')
-rw-r--r-- | scalding/src/test/scala/sandcrawler/ScoreJobTest.scala | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala b/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala index 32fb16c..c3e4ff9 100644 --- a/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala +++ b/scalding/src/test/scala/sandcrawler/ScoreJobTest.scala @@ -222,15 +222,22 @@ class ScoreJobTest extends FlatSpec with Matchers { } def bundle(slug : String, grobidIndex : Int, crossrefIndex : Int) : (String, Int, String, String) = { - val mf1 : MapFeatures = GrobidScorable.jsonToMapFeatures( + GrobidScorable.jsonToMapFeatures( Sha1Strings(grobidIndex), - JsonStrings(grobidIndex)) - val mf2 : MapFeatures = CrossrefScorable.jsonToMapFeatures( - CrossrefStrings(crossrefIndex)) - val score = Scorable.computeSimilarity( - ReduceFeatures(mf1.json), - ReduceFeatures(mf2.json)) - (slug, score, mf1.json, mf2.json) + JsonStrings(grobidIndex)) match { + case None => fail() + case Some(mf1) => { + CrossrefScorable.jsonToMapFeatures(CrossrefStrings(crossrefIndex)) match { + case None => fail() + case Some(mf2) => { + val score = Scorable.computeSimilarity( + ReduceFeatures(mf1.json), + ReduceFeatures(mf2.json)) + (slug, score, mf1.json, mf2.json) + } + } + } + } } it should "have right output values" in { |