diff options
Diffstat (limited to 'scalding/src/main')
-rw-r--r-- | scalding/src/main/resources/slug-denylist.txt (renamed from scalding/src/main/resources/slug-blacklist.txt) | 0 | ||||
-rw-r--r-- | scalding/src/main/scala/sandcrawler/ScorableFeatures.scala | 6 |
2 files changed, 3 insertions, 3 deletions
diff --git a/scalding/src/main/resources/slug-blacklist.txt b/scalding/src/main/resources/slug-denylist.txt index 926dbd5..926dbd5 100644 --- a/scalding/src/main/resources/slug-blacklist.txt +++ b/scalding/src/main/resources/slug-denylist.txt diff --git a/scalding/src/main/scala/sandcrawler/ScorableFeatures.scala b/scalding/src/main/scala/sandcrawler/ScorableFeatures.scala index be2b495..95a39aa 100644 --- a/scalding/src/main/scala/sandcrawler/ScorableFeatures.scala +++ b/scalding/src/main/scala/sandcrawler/ScorableFeatures.scala @@ -8,8 +8,8 @@ import scala.util.parsing.json.JSONObject object ScorableFeatures { // TODO: Add exception handling. - val fileStream : InputStream = getClass.getResourceAsStream("/slug-blacklist.txt") - val SlugBlacklist : Set[String] = Source.fromInputStream(fileStream).getLines.toSet + val fileStream : InputStream = getClass.getResourceAsStream("/slug-denylist.txt") + val SlugDenylist : Set[String] = Source.fromInputStream(fileStream).getLines.toSet fileStream.close val MinSlugLength = 8 @@ -44,7 +44,7 @@ class ScorableFeatures private(title : String, authors : List[Any] = List(), yea val slug = StringUtilities.removePunctuation((unaccented.toLowerCase())).replaceAll("\\s", "") if (slug.isEmpty || slug == null - || (ScorableFeatures.SlugBlacklist contains slug) + || (ScorableFeatures.SlugDenylist contains slug) || (slug.length < ScorableFeatures.MinSlugLength)) { None } else { |