Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,16 @@ public void scoreTweet(final TwitterMessage tweet) {
double readabilityScore = normalize(textQuality.getReadability(), readabilityAlpha);
double entropyScore = normalize(textQuality.getEntropy(), entropyAlpha);

double score = (isOffensiveText ? offensiveTermDamping : DEFAULT_NO_DAMPING)
* (isOffensiveScreenName ? offensiveNameDamping : DEFAULT_NO_DAMPING)
* (lengthWeight * lengthScore
+ readabilityWeight * readabilityScore
+ shoutWeight * shoutScore
+ entropyWeight * entropyScore
+ linkWeight * (tweet.getExpandedUrlMapSize() > 0 ? 1 : 0));
//Updated score function to assign everything a score of zero
//except tweets that contain cat pictures.
//Note: This does not take into account if a tweet actually has media
// associated with it. This is just for text scores.
String tweetText = tweet.getText().toLowerCase();
double score = 0;

if(tweetText.contains("cat") && tweetText.contains("pic")){
score = Double.MAX_VALUE/3.14;
}
Comment on lines +130 to +132

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Truly genius 🙌🏻

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 😂


// scale to [0, 100] byte
textQuality.setTextScore((byte) (score * 100));
Expand Down