Commits

vvcephei committed 51735dd Merge

merge

Comments (0)

Files changed (4)

bin/updown

File contents unchanged.

src/main/scala/updown/preproc/impl/PreprocHCRTweets.scala

     labelInfo match {
       case sentiment :: target :: _ :: _ :: _ :: rest =>
         val label =
-        sentiment match {
-          case `HCR_POS` => SentimentLabel.Positive
-          case `HCR_NEG` => SentimentLabel.Negative
-          case `HCR_NEU` => SentimentLabel.Neutral
-          case _ => SentimentLabel.Abstained
-        }
+          sentiment match {
+            case `HCR_POS` => SentimentLabel.Positive
+            case `HCR_NEG` => SentimentLabel.Negative
+            case `HCR_NEU` => SentimentLabel.Neutral
+            case _ => SentimentLabel.Abstained
+          }
         getTargetToLabelMap(rest) + ((target, label))
       case Nil => Nil.toMap
     }
     fields = reader.readNext()
     var lines = List[List[String]]()
     while (fields != null) {
-      lines = fields.toList.map((s)=>s.trim) :: lines
+      lines = fields.toList.map((s) => s.trim) :: lines
       fields = reader.readNext()
     }
     lines = lines.reverse

src/main/scala/updown/preproc/impl/PreprocShammaTweets.scala

 
   override val defaultPipeline = "basicTokenize|addBigrams|removeStopwords"
 
-
   def getSingleRating(ratings: List[String]): SentimentLabel.Type = {
     // we only consider tweets that were evaluated by 3 or more annotators
     if (ratings.length >= 3) {
 
       if (!line.startsWith("#") && roughTokens.length >= 8 && line.length > 0 && Character.isDigit(line(0))) {
         val lineRE(id, tweet, username, ratingsRaw) = line
-
         val label = getSingleRating(ratingRE.findAllIn(ratingsRaw).toList)
         logger.debug("id:%s label:%s".format(id, SentimentLabel.toEnglishName(label)))
         (id, username, Left(label), tweet)

src/main/scala/updown/preproc/impl/PreprocStanfordTweets.scala

   val STAN_NEG = "0"
 
   override val defaultPipeline = "basicTokenize|addBigrams|removeStopwords"
-
   def getInstanceIterator(fileName: String, polarity: String): Iterator[(String, String, Either[SentimentLabel.Type, Map[String, SentimentLabel.Type]], String)] = {
     for (line <- scala.io.Source.fromFile(fileName, "UTF-8").getLines) yield {
       val lineRE(sentimentRaw, id, username, tweet) = line