foxdear_ebooks 3.1.7 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/foxdear_ebooks/model.rb +2 -2
- data/lib/foxdear_ebooks/nlp.rb +1 -1
- data/lib/foxdear_ebooks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7b8c09c1a31d65195b5a931af9a7476fc2632ec
|
|
4
|
+
data.tar.gz: 447c89083facbdcabfa0766124b457aa2e9b5070
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53290f2cc4f0f88c9915033d550dc21e0b7f6424377d4aa8a3e0e89bf454bf131c6e57fffdb5b6a093457a89457f3a2e68e6bb914207b591cab3d7c357532728
|
|
7
|
+
data.tar.gz: 596f5231a17b5db3e0573328ed570251955636661a68937c1677f0c24330abef6994ce1a598f7d6de1f308ce32b67608659b04f979d3c38e7a05fc02edeeb0cb
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# twitter\_ebooks
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/foxdear_ebooks)
|
|
4
|
-
[](https://travis-ci.org/foxdear/foxdear_ebooks)
|
|
5
|
+
[](https://gemnasium.com/foxdear/foxdear_ebooks)
|
|
6
6
|
|
|
7
7
|
A framework for building interactive twitterbots which respond to mentions/DMs. See [ebooks_example](https://github.com/mispy/ebooks_example) for a fully-fledged bot definition.
|
|
8
8
|
|
data/lib/foxdear_ebooks/model.rb
CHANGED
|
@@ -101,7 +101,7 @@ module Ebooks
|
|
|
101
101
|
def initialize
|
|
102
102
|
@tokens = []
|
|
103
103
|
@banned_words_file ||= 'banned_words.txt'
|
|
104
|
-
@banned_words ||= File.exists?(@banned_words_file) ? File.read(@banned_words_file).split : []
|
|
104
|
+
@banned_words ||= File.exists?(@banned_words_file) ? File.read(@banned_words_file).split("\n") : []
|
|
105
105
|
# Reverse lookup tiki by token, for faster generation
|
|
106
106
|
@tikis = {}
|
|
107
107
|
end
|
|
@@ -125,7 +125,7 @@ module Ebooks
|
|
|
125
125
|
return if @banned_words_file == path
|
|
126
126
|
@banned_words_file = path
|
|
127
127
|
if File.exists?(@banned_words_file)
|
|
128
|
-
@banned_words = File.read(@banned_words_file).split
|
|
128
|
+
@banned_words = File.read(@banned_words_file).split("\n")
|
|
129
129
|
log "Successfully loaded banned words list #{path}"
|
|
130
130
|
else
|
|
131
131
|
log "Error: Banned words list #{path} does not exist"
|
data/lib/foxdear_ebooks/nlp.rb
CHANGED
|
@@ -87,7 +87,7 @@ module Ebooks
|
|
|
87
87
|
# @return [Highscore::Keywords]
|
|
88
88
|
def self.keywords(text)
|
|
89
89
|
# Preprocess to remove stopwords (highscore's blacklist is v. slow)
|
|
90
|
-
text = NLP.tokenize(text).reject { |t| stopword?(t) }.join(' ')
|
|
90
|
+
text = NLP.tokenize(text).reject { |t| stopword?(t) || t.start_with?('http') }.join(' ')
|
|
91
91
|
|
|
92
92
|
text = Highscore::Content.new(text)
|
|
93
93
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foxdear_ebooks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kait Foxdear, Jaiden Mispy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|