lingvo 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/lingvo +1 -1
- data/lib/lingvo/config/config.rb +2 -2
- data/lib/lingvo/console/command.rb +34 -8
- data/lib/lingvo/parsers/words_counter_parser.rb +1 -1
- data/lib/lingvo/version.rb +1 -1
- data/lingvo.gemspec +7 -7
- metadata +36 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94666dae623540164d10b616ca09ce8528572359
|
4
|
+
data.tar.gz: f9daaf5c70dbc7a2403d012e3abca2da28f8d270
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e4ae83a1dd7df38f7fb603c4c4d2b5d55374f50a2052b1d5f82f5e5cc2697f8e58604a701402884989846df1378782cba64bd3c95180d05886d67e87bdd3ddf
|
7
|
+
data.tar.gz: e3ac5b214006e3cf5418e870290e2ea51355261976236ae5e67f378996464896dd576dfb83e90a8ecdd6e394d151bcacc13a4cde37aee34cd31df0718df20a91
|
data/bin/lingvo
CHANGED
data/lib/lingvo/config/config.rb
CHANGED
@@ -17,8 +17,6 @@ module Lingvo
|
|
17
17
|
DB_FILE = File.join BASE_DIR, 'english_words.sqlite3'
|
18
18
|
CUSTOM_CONFIG = File.join BASE_DIR, 'config.yaml'
|
19
19
|
|
20
|
-
$stderr = File.open File.join(BASE_DIR + 'app.log'), 'w'
|
21
|
-
|
22
20
|
unless File.exists? BASE_DIR
|
23
21
|
FileUtils.mkdir BASE_DIR, mode: 0755
|
24
22
|
end
|
@@ -33,6 +31,8 @@ module Lingvo
|
|
33
31
|
FileUtils.chmod 0755, CUSTOM_CONFIG
|
34
32
|
end
|
35
33
|
|
34
|
+
$stderr = File.open File.join(BASE_DIR, 'app.log'), 'w'
|
35
|
+
|
36
36
|
default_config = YAML.load_file DEFAULT_CONFIG
|
37
37
|
custom_config = YAML.load_file CUSTOM_CONFIG
|
38
38
|
|
@@ -11,12 +11,32 @@ Options:
|
|
11
11
|
key: n - show next word
|
12
12
|
q - close window
|
13
13
|
|
14
|
-
--wc f1 [f2]
|
14
|
+
--wc f1 [f2] - parse text file(f1), and write statistic to file(f2)
|
15
|
+
or show in console if file(f2) isn't specify
|
15
16
|
|
16
17
|
--size - show words count
|
17
18
|
-v - show version
|
18
19
|
-h - show this help
|
19
20
|
|
21
|
+
Description:
|
22
|
+
|
23
|
+
○ Load words from lingualeo.ru and train with lingvo
|
24
|
+
· go to lingualeo site
|
25
|
+
· select words which you want
|
26
|
+
· go to print page and save it (like: print.html)
|
27
|
+
|
28
|
+
· $ lingvo --parse print.html
|
29
|
+
· Well Done!!! Now You have all words in lingvo ;)
|
30
|
+
|
31
|
+
○ Parse document and build statistics
|
32
|
+
· save your text like english.txt file
|
33
|
+
|
34
|
+
· $ lingvo --wc english.txt
|
35
|
+
· show your statistic immediatly in console
|
36
|
+
|
37
|
+
· $ lingvo --wc english.txt statistics.txt
|
38
|
+
· open statistics.txt and see your words amount
|
39
|
+
|
20
40
|
"""
|
21
41
|
|
22
42
|
class << self
|
@@ -32,7 +52,7 @@ Options:
|
|
32
52
|
end
|
33
53
|
|
34
54
|
def no_word
|
35
|
-
|
55
|
+
Command.words_not_found
|
36
56
|
exit
|
37
57
|
end
|
38
58
|
end
|
@@ -46,19 +66,19 @@ Options:
|
|
46
66
|
end
|
47
67
|
|
48
68
|
def words_counter(from, to)
|
49
|
-
return file_not_found
|
69
|
+
return file_not_found unless File.exists? from
|
50
70
|
Parsers::WordsCounter.new from, to
|
51
71
|
end
|
52
72
|
|
53
73
|
def rand(count)
|
54
|
-
|
55
|
-
Models::English.rand(count).each do |word|
|
74
|
+
return words_not_found unless Models::English.any?
|
75
|
+
Models::English.rand((count || 1).to_i).each do |word|
|
56
76
|
printf "%-20s %-20s %s\n", word.eng, word.transcr, word.ru
|
57
77
|
end
|
58
78
|
end
|
59
79
|
|
60
80
|
def size
|
61
|
-
puts "\nYou have #{Models::English.count} words
|
81
|
+
puts "\nYou have #{Models::English.count} words"
|
62
82
|
end
|
63
83
|
|
64
84
|
def notify
|
@@ -73,10 +93,16 @@ Options:
|
|
73
93
|
puts HELP
|
74
94
|
end
|
75
95
|
|
76
|
-
|
96
|
+
def version
|
97
|
+
puts "\n#{VERSION}"
|
98
|
+
end
|
77
99
|
|
78
100
|
def file_not_found
|
79
|
-
puts "\nFile not found
|
101
|
+
puts "\nFile not found!"
|
102
|
+
end
|
103
|
+
|
104
|
+
def words_not_found
|
105
|
+
puts "\nYou don't have any words"
|
80
106
|
end
|
81
107
|
end
|
82
108
|
end
|
data/lib/lingvo/version.rb
CHANGED
data/lingvo.gemspec
CHANGED
@@ -19,12 +19,12 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency "rspec"
|
24
|
-
spec.add_development_dependency "qtbindings"
|
22
|
+
spec.add_development_dependency "rake", "~> 10"
|
23
|
+
spec.add_development_dependency "rspec", "~> 2.0"
|
24
|
+
spec.add_development_dependency "qtbindings", "~> 4.8"
|
25
25
|
|
26
|
-
spec.add_development_dependency "activerecord"
|
27
|
-
spec.add_development_dependency "sqlite3"
|
28
|
-
spec.add_development_dependency "activerecord-jdbcsqlite3-adapter"
|
29
|
-
spec.add_development_dependency "nokogiri"
|
26
|
+
spec.add_development_dependency "activerecord", "~> 3.0"
|
27
|
+
spec.add_development_dependency "sqlite3", "~> 1.3"
|
28
|
+
spec.add_development_dependency "activerecord-jdbcsqlite3-adapter", "~> 1.2"
|
29
|
+
spec.add_development_dependency "nokogiri", "~> 1.6"
|
30
30
|
end
|
metadata
CHANGED
@@ -1,127 +1,127 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lingvo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor G
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '10'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '10'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: qtbindings
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '4.8'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '4.8'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activerecord
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: sqlite3
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ~>
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.3'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '1.3'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: activerecord-jdbcsqlite3-adapter
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1.2'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ~>
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '1.2'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: nokogiri
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '1.6'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '1.6'
|
125
125
|
description: Will help don't forget english words
|
126
126
|
email:
|
127
127
|
- igor.s04@mail.ru
|
@@ -130,7 +130,7 @@ executables:
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
-
-
|
133
|
+
- .gitignore
|
134
134
|
- Gemfile
|
135
135
|
- LICENSE.txt
|
136
136
|
- README.md
|
@@ -160,17 +160,17 @@ require_paths:
|
|
160
160
|
- lib
|
161
161
|
required_ruby_version: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
|
-
- -
|
163
|
+
- - '>='
|
164
164
|
- !ruby/object:Gem::Version
|
165
165
|
version: '0'
|
166
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
167
|
requirements:
|
168
|
-
- -
|
168
|
+
- - '>='
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.0.14
|
174
174
|
signing_key:
|
175
175
|
specification_version: 4
|
176
176
|
summary: Lingvo - easy helper in learning english words
|