ark_tweet_nlp 0.2.0 → 0.2.1
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/lib/ark_tweet_nlp/parser.rb +1 -2
- data/lib/ark_tweet_nlp/version.rb +1 -1
- data/spec/parser_spec.rb +20 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1b3260363eb025c2536fa1e6285a19a722fe2b5
|
4
|
+
data.tar.gz: c3829a1dece24316594a9559cde223dc99ce81d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70b20f9826d29940bd7e05a6ab056a1e9d6328c2fbfcffec9181d1e6f18a125e90e8a882d8c93d75c9c96551845181e270ecbb5be72af7fad71ed17241084457
|
7
|
+
data.tar.gz: ab88602b2c048593b668c2967d0356a61b9501551261ecb25d6c96a1fe673c4f5f61d739b2335306c0d1f6fb3bd377e1648ece8e5356e74cf211272067dd62fb
|
data/lib/ark_tweet_nlp/parser.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -15,14 +15,32 @@ describe ArkTweetNlp::Parser do
|
|
15
15
|
it "suports urls" do
|
16
16
|
expect(ArkTweetNlp::Parser.find_tags("I think I haven't had a segmentation fault in years http://t.co/COjaaFj6Ib")).to eq( [{"I"=>:O,
|
17
17
|
"think"=>:V,
|
18
|
-
"
|
18
|
+
"havent"=>:V,
|
19
19
|
"had"=>:V,
|
20
20
|
"a"=>:D,
|
21
21
|
"segmentation"=>:N,
|
22
22
|
"fault"=>:N,
|
23
23
|
"in"=>:P,
|
24
24
|
"years"=>:N,
|
25
|
-
"
|
25
|
+
"httptcoCOjaaFj6Ib"=>:"$"}])
|
26
|
+
end
|
27
|
+
it "removes ponctuation from the tweets" do
|
28
|
+
expect(ArkTweetNlp::Parser.find_tags("Delayed... And waiting on a tire from Louisville. \"You can't be serious #Disappointed #pissed #letdown http://t.co/BFqsPZmr8m")).to eq([{"Delayed"=>:A,
|
29
|
+
"And"=>:&,
|
30
|
+
"waiting"=>:V,
|
31
|
+
"on"=>:P,
|
32
|
+
"a"=>:D,
|
33
|
+
"tire"=>:N,
|
34
|
+
"from"=>:P,
|
35
|
+
"Louisville"=>:^,
|
36
|
+
"You"=>:O,
|
37
|
+
"cant"=>:V,
|
38
|
+
"be"=>:V,
|
39
|
+
"serious"=>:A,
|
40
|
+
"#Disappointed"=>:"#",
|
41
|
+
"#pissed"=>:"#",
|
42
|
+
"#letdown"=>:"#",
|
43
|
+
"httptcoBFqsPZmr8m"=>:"#"}])
|
26
44
|
end
|
27
45
|
it "tags multiple tweets per line" do
|
28
46
|
expect(ArkTweetNlp::Parser.find_tags("faceboooooooook is awesome\nfaceboooooooook is awesome")).to eq([{'faceboooooooook' => :^,'is' => :V,'awesome' => :A},{'faceboooooooook' => :^,'is' => :V,'awesome' => :A} ])
|