apion 0.1.6 → 0.1.7
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/apion.gemspec +2 -2
- data/bin/apion +2 -2
- data/lib/apion.rb +10 -14
- data/lib/string.rb +13 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f482216b13883859deeed5d20f2e25e5a572815c
|
4
|
+
data.tar.gz: 04e234d2036e85bdfee7772cad1fd10b033431e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcf03529b2a1ace0aa6b383c13549a30c761bc3ca2e3b8da6d71bce09b1e32c48e5ea2a1f55df84d57a663fd2f833311232d5ebd62c5e6667d2bec0864da06d5
|
7
|
+
data.tar.gz: 5d4d2e59fcb5a7ecbb9eb323fee070c97fe41241ffbe54e5d753371804c92e32fe2efa1447859e023e936ed76455cb73b176a01b85a1ed7116210a4858358c16
|
data/apion.gemspec
CHANGED
data/bin/apion
CHANGED
data/lib/apion.rb
CHANGED
@@ -1,35 +1,31 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
class Apion
|
4
4
|
|
5
5
|
require "json"
|
6
6
|
require "timeout"
|
7
7
|
|
8
8
|
ROOT = File.expand_path("../..", __FILE__)
|
9
9
|
eval(File.read("#{ROOT}/lib/special_chars.rb"))
|
10
|
-
|
10
|
+
attr_accessor :timeout
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@timeout = 0.2
|
14
|
+
end
|
11
15
|
|
12
|
-
def
|
16
|
+
def parseCSV(path)
|
13
17
|
Hash[File.open("#{ROOT}/data/#{path}.csv").read.split("\n").map {|ligne| ligne.split("#")}]
|
14
18
|
end
|
15
19
|
|
16
|
-
def
|
20
|
+
def exceptions
|
17
21
|
@exceptions ||= JSON.parse(File.read("#{ROOT}/data/dict.json"))
|
18
22
|
end
|
19
23
|
|
20
|
-
def
|
24
|
+
def conversion
|
21
25
|
@conversion ||= parseCSV "conversion"
|
22
26
|
end
|
23
27
|
|
24
|
-
def
|
25
|
-
@timeout = seconds
|
26
|
-
end
|
27
|
-
|
28
|
-
def Apion.timeout
|
29
|
-
@timeout
|
30
|
-
end
|
31
|
-
|
32
|
-
def Apion.apion(texte)
|
28
|
+
def apion(texte)
|
33
29
|
texte = texte.downcase
|
34
30
|
texte.gsub(SPE, "").split.map do |mot|
|
35
31
|
exceptions[mot] || "".tap do |result|
|
data/lib/string.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Galaad Gauthier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -34,6 +34,7 @@ files:
|
|
34
34
|
- Gemfile
|
35
35
|
- apion.gemspec
|
36
36
|
- lib/special_chars.rb
|
37
|
+
- lib/string.rb
|
37
38
|
- lib/apion.rb
|
38
39
|
- data/dict.json
|
39
40
|
- data/conversion.csv
|