Skip to content
Browse files

Minor refactoring.

  • Loading branch information...
1 parent d72df1b commit f180f0900e9ff75e00a9067229fefe431499bf9f @echen committed
Showing with 21 additions and 1 deletion.
  1. +3 −1 BookCrossing.scala
  2. +6 −0 Foursquare.scala
  3. +6 −0 ITunes.scala
  4. +6 −0 RottenTomatoes.scala
View
4 BookCrossing.scala
@@ -15,10 +15,12 @@ class BookCrossing(args : Args) extends VectorSimilarities(args) {
override val MAX_NUM_RATERS = 1000
override val MIN_INTERSECTION = 2
+ /**
+ * Reads in the Book-Crossing dataset.
+ */
override def input(userField : Symbol, itemField : Symbol, ratingField : Symbol) : Pipe = {
val bookCrossingRatings =
Tsv("book-ratings.tsv")
- .read
.mapTo((0, 1, 2) -> (userField, itemField, ratingField)) { fields : (String, String, Double) => fields }
bookCrossingRatings
View
6 Foursquare.scala
@@ -22,6 +22,12 @@ class Foursquare(args : Args) extends VectorSimilarities(args) {
override val MAX_NUM_RATERS = 1000
override val MIN_INTERSECTION = 2
+ /**
+ * Searches Twitter for Foursquare checkins.
+ *
+ * Output is a pipe, where each row is of the form:
+ * (user = 235452312, item = "Statue of Liberty", rating = 1)
+ */
override def input(userField : Symbol, itemField : Symbol, ratingField : Symbol) : Pipe = {
val foursquareCheckins =
// This is a Twitter-internal source that reads tweets off hdfs.
View
6 ITunes.scala
@@ -20,6 +20,12 @@ class ITunes(args : Args) extends VectorSimilarities(args) {
override val MAX_NUM_RATERS = 1000
override val MIN_INTERSECTION = 5
+ /**
+ * Searches Twitter for iTunes ratings.
+ *
+ * Output is a pipe, where each row is of the form:
+ * (user = 124802, item = "Kumbaya by Britney Spears", rating = 4)
+ */
override def input(userField : Symbol, itemField : Symbol, ratingField : Symbol) : Pipe = {
val itunesRatings =
// This is a Twitter-internal source that reads tweets off hdfs.
View
6 RottenTomatoes.scala
@@ -24,6 +24,12 @@ class RottenTomatoes(args : Args) extends VectorSimilarities(args) {
override val MAX_NUM_RATERS = 1000
override val MIN_INTERSECTION = 2
+ /**
+ * Searches Twitter for RottenTomatoes ratings.
+ *
+ * Output is a pipe, where each row is of the form:
+ * (user = 124802, item = "Dark Knight Rises", rating = 3)
+ */
override def input(userField : Symbol, itemField : Symbol, ratingField : Symbol) : Pipe = {
val rottenTomatoesRatings =
TweetSource()

0 comments on commit f180f09

Please sign in to comment.
Something went wrong with that request. Please try again.