text_analysis 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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/text_analysis.rb +3 -1
- data/lib/text_analysis/version.rb +1 -1
- 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: f7a0300244ea6804b7bd37bb0f7f05004e881b43
|
4
|
+
data.tar.gz: 72970db79eee8e68ab43b65bedede259d3a2e0a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 687ac822acd92fd8f23764c0b93880bb6c7e834d25dc36f0a807a3b83b6f2dbb16e9b7ac5786c39680a009841c04c5e2d0080aa212d928130aded8da3bb543f9
|
7
|
+
data.tar.gz: a05f9b1c79610260da81c5c41789ce37cc6b51978fb2a21ba4295d0f198641b35ba4d07940c506acb79119f0f8002397577bb6773dc1117586d8738947774a7e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/text_analysis.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require "text_analysis/version"
|
2
2
|
|
3
3
|
module TextAnalysis
|
4
|
+
ROOT = File.expand_path("../..", __FILE__)
|
5
|
+
|
4
6
|
def self.analyze_text(text_input)
|
5
7
|
result = Result.new
|
6
8
|
|
7
|
-
stop_words = File.readlines(
|
9
|
+
stop_words = File.readlines("#{ROOT}/data/stop_words/en.txt").map { |word| word.gsub("\n", '') }.inspect
|
8
10
|
input_words = text_input.split(/[\s]+/)
|
9
11
|
|
10
12
|
result.total_characters = text_input.length
|