xws 0.1.5 → 0.2.0

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/xws.rb +3 -18
  5. metadata +22 -2
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00bcb14b29c54b61ec1be732cfbb971232c5ff67
4
- data.tar.gz: 6e73b9ea80521a220e032f38447273cfee0b4213
3
+ metadata.gz: 896297aa8ddd13046c3f43bf0809feb47771bc9d
4
+ data.tar.gz: 357fa8fe34048887ba0409e2d6fbfda0f517d388
5
5
  SHA512:
6
- metadata.gz: 34467b0169b94dc87d67282965730992d4368f8f170f4d4088b860dd78860cf9b32353c0213554f67919b96e974c51c11bb119b5471470e15f84284a3d922615
7
- data.tar.gz: 3eb202d2b27011c3c86da01369123cbd9dc7cb58b1dead15b84a550c850f6656bba022dc12d145ed334cd48e386b9ea7182e340342cd603a3b911cc0ccf057fd
6
+ metadata.gz: 4fdae1de950f15e87c4d0282d2b847afe2dfa62d5b3391b57c71ff7901e5e7ceb56d520670dc7a1c1af618489016536a01073fdee85d05ea6f89098eb2623e8a
7
+ data.tar.gz: a6429cf4ef6fe8d0990287856dd31ed757aea57776a67e48145daf5e6fbd25abb27d52937175a1208857dbc1a874ed63ed4c24a6d63a799ca5b40737219fd708
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/xws.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  # file: xws.rb
4
4
 
5
+ require 'yawc'
5
6
  require 'rexle'
6
7
 
7
8
 
@@ -10,7 +11,7 @@ class XWS
10
11
  def initialize(ignore_elements: %i(pre code time))
11
12
 
12
13
  @ignore_elements = ignore_elements
13
- @ignorewords = %i(the and or)
14
+
14
15
  end
15
16
 
16
17
  def scan(node)
@@ -24,23 +25,7 @@ class XWS
24
25
  end
25
26
  end
26
27
 
27
- words(a.join(' ')).split.group_by(&:to_s).\
28
- inject({}){|r, x| r.merge(String.new(x[0]).\
29
- force_encoding("utf-8") => x[-1].length)}
30
-
31
- end
32
-
33
- def words(s)
34
-
35
- s.downcase.
36
- gsub(/\w+'\w+/,''). # remove words containing an apostrophe
37
- gsub(/["']/,''). # remove quotation marks
38
- gsub(/(\w)[^a-z ]+\B|\B[^a-z #]+(\w)/,'\1\2'). # remove
39
- # non-alpabetical characters from start or beginning of words
40
- gsub(/\s.\s/,' '). # remove single digits
41
- gsub(/\b(?:#{@ignorewords.join('|')})\b/,''). # ignore common words
42
- gsub(/\B[^\w#]\B+/,'') # remove any other items which are
43
- # not words or hashtags
28
+ Yawc.new(a.join(' ')).to_h
44
29
 
45
30
  end
46
31
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,8 +31,28 @@ cert_chain:
31
31
  gBElgRX/rNJ5r9tumb1VJ+TZMg8fu7CmCoC4FuJtnA7ajJHeC0JKSpCDYtgiOs4W
32
32
  ET+JXG7GYubSoQ==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-11-13 00:00:00.000000000 Z
34
+ date: 2016-05-04 00:00:00.000000000 Z
35
35
  dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: yawc
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '0.1'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 0.1.0
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.1'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 0.1.0
36
56
  - !ruby/object:Gem::Dependency
37
57
  name: rexle
38
58
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file