aboutsummaryrefslogtreecommitdiffstats
path: root/scalding/src/main/scala/sandcrawler/GrobidScorable.scala
diff options
context:
space:
mode:
authorEllen Spertus <ellen.spertus@gmail.com>2018-08-09 20:26:31 -0700
committerEllen Spertus <ellen.spertus@gmail.com>2018-08-09 20:26:31 -0700
commit28c0518379d226ac25597c2840c5c81bd8551487 (patch)
tree3414260a4e7f02cf6142f84484a62460ab3c2753 /scalding/src/main/scala/sandcrawler/GrobidScorable.scala
parent818ad070626d6af7c490017e0bd9b53f30f20150 (diff)
downloadsandcrawler-28c0518379d226ac25597c2840c5c81bd8551487.tar.gz
sandcrawler-28c0518379d226ac25597c2840c5c81bd8551487.zip
WIP
Diffstat (limited to 'scalding/src/main/scala/sandcrawler/GrobidScorable.scala')
-rw-r--r--scalding/src/main/scala/sandcrawler/GrobidScorable.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/scalding/src/main/scala/sandcrawler/GrobidScorable.scala b/scalding/src/main/scala/sandcrawler/GrobidScorable.scala
index 6229718..5c6b140 100644
--- a/scalding/src/main/scala/sandcrawler/GrobidScorable.scala
+++ b/scalding/src/main/scala/sandcrawler/GrobidScorable.scala
@@ -10,13 +10,14 @@ import parallelai.spyglass.hbase.HBasePipeConversions
import parallelai.spyglass.hbase.HBaseSource
class GrobidScorable extends Scorable with HBasePipeConversions {
- def getFeaturesPipe(args : Args) : TypedPipe[MapFeatures] = {
+ def getSource(args : Args) : Source = {
// TODO: Generalize args so there can be multiple grobid pipes in one job.
GrobidScorable.getHBaseSource(args("hbase-table"), args("zookeeper-hosts"))
- .read
+ }
+
+ def getFeaturesPipe(pipe : Pipe) : TypedPipe[MapFeatures] = {
+ pipe
.fromBytesWritable(new Fields("key", "tei_json"))
- // TODO: Figure out why this line (used in HBaseCrossrefScoreJob.scala)
- // didn't work here: .toTypedPipe[(String, String)]('key, 'tei_json)
.toTypedPipe[(String, String)](new Fields("key", "tei_json"))
.map { entry =>
val (key : String, json : String) = (entry._1, entry._2)