ark_tweet_nlp 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 854e565fc320e10f108899d9fd46ee4e574224e0
4
- data.tar.gz: b0ed001019d18998339e89360b72a74fc66d82c3
3
+ metadata.gz: f1b3260363eb025c2536fa1e6285a19a722fe2b5
4
+ data.tar.gz: c3829a1dece24316594a9559cde223dc99ce81d5
5
5
  SHA512:
6
- metadata.gz: b081388bbaa6a4dc4b4146816225cc1e55d99a84ad1b4a149702a031fb02db6532a8c1075dcc7a7a6efda47285110e0fbe139dd6fbda817d809788e3675420b4
7
- data.tar.gz: 10ac78c85e9c80e428d6211e72a90fa5651dfa6b665e979334566d2ca217cfb48e2afaaa0e60bfe4efc15722341fcde5211c503859b42a444622b0ba8eada3bf
6
+ metadata.gz: 70b20f9826d29940bd7e05a6ab056a1e9d6328c2fbfcffec9181d1e6f18a125e90e8a882d8c93d75c9c96551845181e270ecbb5be72af7fad71ed17241084457
7
+ data.tar.gz: ab88602b2c048593b668c2967d0356a61b9501551261ecb25d6c96a1fe673c4f5f61d739b2335306c0d1f6fb3bd377e1648ece8e5356e74cf211272067dd62fb
@@ -59,8 +59,7 @@ module ArkTweetNlp
59
59
 
60
60
  def Parser.run_tagger text
61
61
  #FIXME: regex destroyes urls...
62
- text.gsub /[^\w\s\d#]/, ''
63
- `echo "#{text}" | #{TAGGER_PATH}`
62
+ `echo "#{text.gsub(/[^\w\s\d#]/, '')}" | #{TAGGER_PATH}`
64
63
  end
65
64
 
66
65
  def Parser.convert_line line
@@ -1,3 +1,3 @@
1
1
  module ArkTweetNlp
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
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
- "haven't"=>:V,
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
- "http://t.co/COjaaFj6Ib"=>:U}])
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} ])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ark_tweet_nlp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo