lyracyst 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/lyracyst +84 -27
- data/changelog.md +5 -0
- data/lib/lyracyst.rb +86 -25
- data/readme.md +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36f67dfe963fa4783cee935575cb1c2102f6d8c4
|
4
|
+
data.tar.gz: be91d0d61356c970bda520dd555076968e259bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8215028afaf58b54cdd9e7d9b816fda64fe1c11381af4815e3503be7fd4c451a0c9471a8c88b87ec3a0d454d17c02bc727eae1e7d05dd1739c2e08c4a707b4d9
|
7
|
+
data.tar.gz: 7c3fbcd3e37ef7d6358f36b113b0a6331f687f4a0e6841e5c2a03f6762184f8da866fd5064a5bdce5b399d944cd48dbab737db5102c5f2da8c0e17a97539aa4a
|
data/bin/lyracyst
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# The program takes a search term and returns a list.
|
3
|
+
# The list can be either definitions, related words,
|
4
|
+
# rhymes, or all three at once.
|
5
|
+
#
|
6
|
+
# Author:: Drew Prentice (mailto:weirdpercent@gmail.com)
|
7
|
+
# Copyright:: Copyright (c) 2014 Drew Prentice
|
8
|
+
# License:: MIT
|
2
9
|
|
3
10
|
require 'rubygems'
|
4
11
|
require 'commander/import'
|
@@ -7,18 +14,26 @@ require 'multi_json'
|
|
7
14
|
#require 'nokogiri'
|
8
15
|
require 'open-uri/cached'
|
9
16
|
require 'wordnik'
|
10
|
-
|
17
|
+
|
18
|
+
OpenURI::Cache.cache_path = 'tmp/open-uri'
|
11
19
|
environment='ruby'
|
12
20
|
result=''
|
13
|
-
|
14
|
-
|
15
|
-
program :description, 'A powerful word search tool that fetches definitions, related words, and rhymes.'
|
16
|
-
#search='test' # (urlencoded string)
|
17
|
-
#print "Enter a word: " #change commenting here to convert between command line and test modes
|
21
|
+
|
22
|
+
# Handles tasks related to fetching queries
|
18
23
|
class Fetch
|
24
|
+
|
25
|
+
# Opens URL and returns the JSON response.
|
26
|
+
#
|
27
|
+
# @param url [String] The query URL
|
28
|
+
# @param result [String] The JSON response.
|
19
29
|
def search(url, result)
|
20
|
-
result=open(url).read
|
30
|
+
result=open(url).read
|
21
31
|
end
|
32
|
+
|
33
|
+
# Sets today's date and writes it with querycount to syncqc.json.
|
34
|
+
#
|
35
|
+
# @param dateint [Fixnum] Today's date in integer form.
|
36
|
+
# @param querycount [Fixnum] Number of daily queries in integer form.
|
22
37
|
def update(dateint, querycount)
|
23
38
|
qct={'date' => dateint, 'querycount' => querycount}
|
24
39
|
fo=File.open("json/synqc.json", "w+")
|
@@ -26,6 +41,12 @@ class Fetch
|
|
26
41
|
fo.print tofile
|
27
42
|
fo.close
|
28
43
|
end
|
44
|
+
|
45
|
+
# Extracts related words from JSON response and prints them.
|
46
|
+
#
|
47
|
+
# @param x [Fixnum] Integer always set to zero.
|
48
|
+
# @param y [Fixnum] Number of items in resulta Array minus 1.
|
49
|
+
# @param resulta [Array] An array of values from JSON response.
|
29
50
|
def rel(x, y, resulta)
|
30
51
|
while x <= y
|
31
52
|
resultl=resulta[x]
|
@@ -35,27 +56,45 @@ class Fetch
|
|
35
56
|
x+=1
|
36
57
|
end
|
37
58
|
end
|
59
|
+
|
60
|
+
# Submits search term and parameters to Altervista.
|
61
|
+
# searchlang can be de_DE, el_GR, en_US, es_ES, fr_FR,
|
62
|
+
# it_IT, no_NO, pt_PT, ro_RO, ru_RU, or sk_SK.
|
63
|
+
# dataoutput only takes 'json' right now. This method calls
|
64
|
+
# {Fetch#search} and {Fetch#update}.
|
65
|
+
#
|
66
|
+
# @param search [String] The word or phrase to search for.
|
67
|
+
# @param dateint [Fixnum] Today's date in integer form.
|
68
|
+
# @param result [String] The JSON response.
|
69
|
+
# @param environment [String] Execution environment, right now just ruby.
|
70
|
+
# @param querycount [Fixnum] Number of daily queries in integer form.
|
38
71
|
def submit(search, dateint, result, environment, querycount)
|
39
72
|
urlprefix='http://thesaurus.altervista.org/thesaurus/v1'
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
searchlang='en_US' # it_IT, fr_FR, de_DE, en_US, el_GR, es_ES, de_DE, no_NO, pt_PT, ro_RO, ru_RU, sk_SK
|
44
|
-
dataoutput='json' # xml or json (default xml)
|
73
|
+
apikey=ENV['THESAURUS']
|
74
|
+
searchlang='en_US'
|
75
|
+
dataoutput='json'
|
45
76
|
url="#{urlprefix}?key=#{apikey}&word=#{search}&language=#{searchlang}&output=#{dataoutput}"
|
46
|
-
if environment == 'javascript'
|
77
|
+
if environment == 'javascript'
|
47
78
|
url="#{url}&callback=synonymSearch"
|
48
79
|
end
|
49
80
|
f=Fetch.new()
|
50
|
-
resultj=f.search(url, result)
|
81
|
+
resultj=f.search(url, result)
|
51
82
|
resultp=MultiJson.load(resultj)
|
52
83
|
resulta=resultp['response']
|
53
84
|
x=0
|
54
85
|
y=resulta.length-1
|
55
86
|
f.rel(x, y, resulta)
|
56
|
-
querycount+=1
|
87
|
+
querycount+=1
|
57
88
|
f.update(dateint, querycount)
|
58
89
|
end
|
90
|
+
|
91
|
+
# Formats rhyme results, assumes a space means a
|
92
|
+
# word contraction, i.e. raison d'etre and inserts
|
93
|
+
# an apostrophe. Also removes Arpabet numbers.
|
94
|
+
#
|
95
|
+
# @param x [Fixnum] Integer always set to zero.
|
96
|
+
# @param y [Fixnum] Number of items in resulta Array minus 1.
|
97
|
+
# @param parse [String] The rhyming word to be formatted.
|
59
98
|
def parse(x, y, parse)
|
60
99
|
while x <= y
|
61
100
|
if parse[x] =~ / \d/
|
@@ -71,14 +110,22 @@ class Fetch
|
|
71
110
|
end
|
72
111
|
end
|
73
112
|
end
|
113
|
+
|
114
|
+
# The Search class defines three methods for submitting queries.
|
74
115
|
class Search
|
75
|
-
|
76
|
-
|
77
|
-
|
116
|
+
# Altervista.org's thesaurus service provides related words.
|
117
|
+
# The service limits each API key to 5000 queries a day. If
|
118
|
+
# maximum number of queries has been reached, this methods
|
119
|
+
# will exit. This method calls {Fetch#update} and {Fetch#submit}.
|
120
|
+
#
|
121
|
+
# @param search [String] The word or phrase to search for.
|
122
|
+
# @param result [String] The JSON response.
|
123
|
+
def related(search, result)
|
124
|
+
environment='ruby'; maxqueries=5000; querycount=0; t=Time.now; y=t.year.to_s; m=t.month; d=t.day;
|
125
|
+
if m < 10 then m="0#{m}" else m=m.to_s; end
|
78
126
|
if d < 10 then d="0#{d}" else d=d.to_s; end
|
79
127
|
date="#{y}#{m}#{d}"
|
80
128
|
dateint=date.to_i
|
81
|
-
#pd=Date.parse(date)
|
82
129
|
if File.exist?("json/synqc.json") == true
|
83
130
|
rl=File.readlines("json/synqc.json")
|
84
131
|
rl=rl[0]
|
@@ -86,28 +133,31 @@ class Search
|
|
86
133
|
testdate=loadrl['date']
|
87
134
|
testcount=loadrl['querycount']
|
88
135
|
pdateint=testdate.to_i
|
89
|
-
if dateint > pdateint == true
|
136
|
+
if dateint > pdateint == true
|
90
137
|
f=Fetch.new()
|
91
138
|
f.update(dateint, querycount)
|
92
139
|
end
|
93
140
|
else
|
94
141
|
testcount=0
|
95
142
|
end
|
96
|
-
if testcount < maxqueries
|
143
|
+
if testcount < maxqueries
|
97
144
|
f=Fetch.new()
|
98
145
|
f.submit(search, dateint, result, environment, querycount)
|
99
146
|
else
|
100
147
|
puts "Max queries per day has been reached."
|
101
148
|
end
|
102
149
|
end
|
150
|
+
# Wordnik.com's service provides definitions. The logger
|
151
|
+
# defaults to Rails.logger or Logger.new(STDOUT). Set to
|
152
|
+
# Logger.new('/dev/null') to disable logging.
|
153
|
+
#
|
154
|
+
# @param search [String] The word or phrase to search for.
|
103
155
|
def define(search)
|
104
|
-
|
105
|
-
#apikey=apikey[0].chomp
|
106
|
-
apikey=ENV['WORDNIK'] #access thru ENV vars for safe Travis builds
|
156
|
+
apikey=ENV['WORDNIK']
|
107
157
|
Wordnik.configure do |cfg|
|
108
158
|
cfg.api_key=apikey
|
109
159
|
cfg.response_format='json'
|
110
|
-
cfg.logger = Logger.new('/dev/null')
|
160
|
+
cfg.logger = Logger.new('/dev/null')
|
111
161
|
end
|
112
162
|
define=Wordnik.word.get_definitions(search)
|
113
163
|
define.map { |defi|
|
@@ -116,6 +166,12 @@ class Search
|
|
116
166
|
#puts "Definition: #{part} - #{text} - #{att}" #With attribution to source
|
117
167
|
}
|
118
168
|
end
|
169
|
+
|
170
|
+
# ARPA created ARPABET decades ago to find words that
|
171
|
+
# rhyme. The technology is still quite relevant today.
|
172
|
+
# This program uses the Heroku app based on ARPABET.
|
173
|
+
#
|
174
|
+
# @param search [String] The word or phrase to search for.
|
119
175
|
def rhyme(search)
|
120
176
|
url="http://arpabet.heroku.com/words/#{search}"
|
121
177
|
f=Fetch.new()
|
@@ -129,6 +185,9 @@ class Search
|
|
129
185
|
end
|
130
186
|
end
|
131
187
|
|
188
|
+
program :name, 'lyracyst'
|
189
|
+
program :version, '0.0.5'
|
190
|
+
program :description, 'A powerful word search tool that fetches definitions, related words, and rhymes.'
|
132
191
|
command :get do |c|
|
133
192
|
c.syntax = 'lyracyst get [options]'
|
134
193
|
c.summary = 'Fetches all sources'
|
@@ -162,7 +221,6 @@ command :related do |c|
|
|
162
221
|
c.summary = 'Fetches related words'
|
163
222
|
c.description = 'Uses the Altervista API to get related words'
|
164
223
|
c.example 'Uses the Altervista API to get related words', 'lyracyst related test'
|
165
|
-
#c.option '--some-switch', 'Some switch that does something' # it_IT, fr_FR, de_DE, en_US, el_GR, es_ES, de_DE, no_NO, pt_PT, ro_RO, ru_RU, sk_SK
|
166
224
|
c.action do |args, options|
|
167
225
|
search=args[0]
|
168
226
|
s=Search.new
|
@@ -183,4 +241,3 @@ command :rhyme do |c|
|
|
183
241
|
s.rhyme(search)
|
184
242
|
end
|
185
243
|
end
|
186
|
-
|
data/changelog.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Changelog
|
2
2
|
===
|
3
3
|
|
4
|
+
Version 0.0.5 - Basic documentation
|
5
|
+
- Command-line interface works
|
6
|
+
- No more Code Climate because it doesn't like commander gem
|
7
|
+
- Fixed /bin executable
|
8
|
+
|
4
9
|
Version 0.0.1 - Feature complete
|
5
10
|
- Ruby environment works
|
6
11
|
- Secure Travis build works
|
data/lib/lyracyst.rb
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# The program takes a search term and returns a list.
|
3
|
+
# The list can be either definitions, related words,
|
4
|
+
# rhymes, or all three at once.
|
5
|
+
#
|
6
|
+
# Author:: Drew Prentice (mailto:weirdpercent@gmail.com)
|
7
|
+
# Copyright:: Copyright (c) 2014 Drew Prentice
|
8
|
+
# License:: MIT
|
2
9
|
|
3
10
|
require 'rubygems'
|
4
11
|
require 'commander/import'
|
@@ -7,16 +14,26 @@ require 'multi_json'
|
|
7
14
|
#require 'nokogiri'
|
8
15
|
require 'open-uri/cached'
|
9
16
|
require 'wordnik'
|
10
|
-
|
11
|
-
OpenURI::Cache.cache_path = 'tmp/open-uri'
|
17
|
+
|
18
|
+
OpenURI::Cache.cache_path = 'tmp/open-uri'
|
12
19
|
environment='ruby'
|
13
20
|
result=''
|
14
|
-
|
15
|
-
#
|
21
|
+
|
22
|
+
# Handles tasks related to fetching queries
|
16
23
|
class Fetch
|
24
|
+
|
25
|
+
# Opens URL and returns the JSON response.
|
26
|
+
#
|
27
|
+
# @param url [String] The query URL
|
28
|
+
# @param result [String] The JSON response.
|
17
29
|
def search(url, result)
|
18
|
-
result=open(url).read
|
30
|
+
result=open(url).read
|
19
31
|
end
|
32
|
+
|
33
|
+
# Sets today's date and writes it with querycount to syncqc.json.
|
34
|
+
#
|
35
|
+
# @param dateint [Fixnum] Today's date in integer form.
|
36
|
+
# @param querycount [Fixnum] Number of daily queries in integer form.
|
20
37
|
def update(dateint, querycount)
|
21
38
|
qct={'date' => dateint, 'querycount' => querycount}
|
22
39
|
fo=File.open("json/synqc.json", "w+")
|
@@ -24,6 +41,12 @@ class Fetch
|
|
24
41
|
fo.print tofile
|
25
42
|
fo.close
|
26
43
|
end
|
44
|
+
|
45
|
+
# Extracts related words from JSON response and prints them.
|
46
|
+
#
|
47
|
+
# @param x [Fixnum] Integer always set to zero.
|
48
|
+
# @param y [Fixnum] Number of items in resulta Array minus 1.
|
49
|
+
# @param resulta [Array] An array of values from JSON response.
|
27
50
|
def rel(x, y, resulta)
|
28
51
|
while x <= y
|
29
52
|
resultl=resulta[x]
|
@@ -33,27 +56,45 @@ class Fetch
|
|
33
56
|
x+=1
|
34
57
|
end
|
35
58
|
end
|
59
|
+
|
60
|
+
# Submits search term and parameters to Altervista.
|
61
|
+
# searchlang can be de_DE, el_GR, en_US, es_ES, fr_FR,
|
62
|
+
# it_IT, no_NO, pt_PT, ro_RO, ru_RU, or sk_SK.
|
63
|
+
# dataoutput only takes 'json' right now. This method calls
|
64
|
+
# {Fetch#search} and {Fetch#update}.
|
65
|
+
#
|
66
|
+
# @param search [String] The word or phrase to search for.
|
67
|
+
# @param dateint [Fixnum] Today's date in integer form.
|
68
|
+
# @param result [String] The JSON response.
|
69
|
+
# @param environment [String] Execution environment, right now just ruby.
|
70
|
+
# @param querycount [Fixnum] Number of daily queries in integer form.
|
36
71
|
def submit(search, dateint, result, environment, querycount)
|
37
72
|
urlprefix='http://thesaurus.altervista.org/thesaurus/v1'
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
searchlang='en_US' # it_IT, fr_FR, de_DE, en_US, el_GR, es_ES, de_DE, no_NO, pt_PT, ro_RO, ru_RU, sk_SK
|
42
|
-
dataoutput='json' # xml or json (default xml)
|
73
|
+
apikey=ENV['THESAURUS']
|
74
|
+
searchlang='en_US'
|
75
|
+
dataoutput='json'
|
43
76
|
url="#{urlprefix}?key=#{apikey}&word=#{search}&language=#{searchlang}&output=#{dataoutput}"
|
44
|
-
if environment == 'javascript'
|
77
|
+
if environment == 'javascript'
|
45
78
|
url="#{url}&callback=synonymSearch"
|
46
79
|
end
|
47
80
|
f=Fetch.new()
|
48
|
-
resultj=f.search(url, result)
|
81
|
+
resultj=f.search(url, result)
|
49
82
|
resultp=MultiJson.load(resultj)
|
50
83
|
resulta=resultp['response']
|
51
84
|
x=0
|
52
85
|
y=resulta.length-1
|
53
86
|
f.rel(x, y, resulta)
|
54
|
-
querycount+=1
|
87
|
+
querycount+=1
|
55
88
|
f.update(dateint, querycount)
|
56
89
|
end
|
90
|
+
|
91
|
+
# Formats rhyme results, assumes a space means a
|
92
|
+
# word contraction, i.e. raison d'etre and inserts
|
93
|
+
# an apostrophe. Also removes Arpabet numbers.
|
94
|
+
#
|
95
|
+
# @param x [Fixnum] Integer always set to zero.
|
96
|
+
# @param y [Fixnum] Number of items in resulta Array minus 1.
|
97
|
+
# @param parse [String] The rhyming word to be formatted.
|
57
98
|
def parse(x, y, parse)
|
58
99
|
while x <= y
|
59
100
|
if parse[x] =~ / \d/
|
@@ -69,14 +110,22 @@ class Fetch
|
|
69
110
|
end
|
70
111
|
end
|
71
112
|
end
|
113
|
+
|
114
|
+
# The Search class defines three methods for submitting queries.
|
72
115
|
class Search
|
73
|
-
|
74
|
-
|
75
|
-
|
116
|
+
# Altervista.org's thesaurus service provides related words.
|
117
|
+
# The service limits each API key to 5000 queries a day. If
|
118
|
+
# maximum number of queries has been reached, this methods
|
119
|
+
# will exit. This method calls {Fetch#update} and {Fetch#submit}.
|
120
|
+
#
|
121
|
+
# @param search [String] The word or phrase to search for.
|
122
|
+
# @param result [String] The JSON response.
|
123
|
+
def related(search, result)
|
124
|
+
environment='ruby'; maxqueries=5000; querycount=0; t=Time.now; y=t.year.to_s; m=t.month; d=t.day;
|
125
|
+
if m < 10 then m="0#{m}" else m=m.to_s; end
|
76
126
|
if d < 10 then d="0#{d}" else d=d.to_s; end
|
77
127
|
date="#{y}#{m}#{d}"
|
78
128
|
dateint=date.to_i
|
79
|
-
#pd=Date.parse(date)
|
80
129
|
if File.exist?("json/synqc.json") == true
|
81
130
|
rl=File.readlines("json/synqc.json")
|
82
131
|
rl=rl[0]
|
@@ -84,28 +133,31 @@ class Search
|
|
84
133
|
testdate=loadrl['date']
|
85
134
|
testcount=loadrl['querycount']
|
86
135
|
pdateint=testdate.to_i
|
87
|
-
if dateint > pdateint == true
|
136
|
+
if dateint > pdateint == true
|
88
137
|
f=Fetch.new()
|
89
138
|
f.update(dateint, querycount)
|
90
139
|
end
|
91
140
|
else
|
92
141
|
testcount=0
|
93
142
|
end
|
94
|
-
if testcount < maxqueries
|
143
|
+
if testcount < maxqueries
|
95
144
|
f=Fetch.new()
|
96
145
|
f.submit(search, dateint, result, environment, querycount)
|
97
146
|
else
|
98
147
|
puts "Max queries per day has been reached."
|
99
148
|
end
|
100
149
|
end
|
150
|
+
# Wordnik.com's service provides definitions. The logger
|
151
|
+
# defaults to Rails.logger or Logger.new(STDOUT). Set to
|
152
|
+
# Logger.new('/dev/null') to disable logging.
|
153
|
+
#
|
154
|
+
# @param search [String] The word or phrase to search for.
|
101
155
|
def define(search)
|
102
|
-
|
103
|
-
#apikey=apikey[0].chomp
|
104
|
-
apikey=ENV['WORDNIK'] #access thru ENV vars for safe Travis builds
|
156
|
+
apikey=ENV['WORDNIK']
|
105
157
|
Wordnik.configure do |cfg|
|
106
158
|
cfg.api_key=apikey
|
107
159
|
cfg.response_format='json'
|
108
|
-
cfg.logger = Logger.new('/dev/null')
|
160
|
+
cfg.logger = Logger.new('/dev/null')
|
109
161
|
end
|
110
162
|
define=Wordnik.word.get_definitions(search)
|
111
163
|
define.map { |defi|
|
@@ -114,6 +166,12 @@ class Search
|
|
114
166
|
#puts "Definition: #{part} - #{text} - #{att}" #With attribution to source
|
115
167
|
}
|
116
168
|
end
|
169
|
+
|
170
|
+
# ARPA created ARPABET decades ago to find words that
|
171
|
+
# rhyme. The technology is still quite relevant today.
|
172
|
+
# This program uses the Heroku app based on ARPABET.
|
173
|
+
#
|
174
|
+
# @param search [String] The word or phrase to search for.
|
117
175
|
def rhyme(search)
|
118
176
|
url="http://arpabet.heroku.com/words/#{search}"
|
119
177
|
f=Fetch.new()
|
@@ -126,8 +184,9 @@ class Search
|
|
126
184
|
print "\n"
|
127
185
|
end
|
128
186
|
end
|
187
|
+
|
129
188
|
program :name, 'lyracyst'
|
130
|
-
program :version, '0.0.
|
189
|
+
program :version, '0.0.5'
|
131
190
|
program :description, 'A powerful word search tool that fetches definitions, related words, and rhymes.'
|
132
191
|
command :get do |c|
|
133
192
|
c.syntax = 'lyracyst get [options]'
|
@@ -143,6 +202,7 @@ command :get do |c|
|
|
143
202
|
s.rhyme(search)
|
144
203
|
end
|
145
204
|
end
|
205
|
+
|
146
206
|
command :define do |c|
|
147
207
|
c.syntax = 'lyracyst define [options]'
|
148
208
|
c.summary = 'Fetches definitions'
|
@@ -155,12 +215,12 @@ command :define do |c|
|
|
155
215
|
s.define(search)
|
156
216
|
end
|
157
217
|
end
|
218
|
+
|
158
219
|
command :related do |c|
|
159
220
|
c.syntax = 'lyracyst related [options]'
|
160
221
|
c.summary = 'Fetches related words'
|
161
222
|
c.description = 'Uses the Altervista API to get related words'
|
162
223
|
c.example 'Uses the Altervista API to get related words', 'lyracyst related test'
|
163
|
-
#c.option '--some-switch', 'Some switch that does something' # it_IT, fr_FR, de_DE, en_US, el_GR, es_ES, de_DE, no_NO, pt_PT, ro_RO, ru_RU, sk_SK
|
164
224
|
c.action do |args, options|
|
165
225
|
search=args[0]
|
166
226
|
s=Search.new
|
@@ -168,6 +228,7 @@ command :related do |c|
|
|
168
228
|
s.related(search)
|
169
229
|
end
|
170
230
|
end
|
231
|
+
|
171
232
|
command :rhyme do |c|
|
172
233
|
c.syntax = 'lyracyst rhyme [options]'
|
173
234
|
c.summary = 'Fetches rhymes'
|
data/readme.md
CHANGED
@@ -5,13 +5,16 @@ lyracyst
|
|
5
5
|
|
6
6
|
Constellation Lyra photo by [Scott Roy Atwood](http://en.wikipedia.org/wiki/File:Lyra_constellation_detail_long_exposure.jpg)
|
7
7
|
|
8
|
-
[![Build Status](https://travis-ci.org/weirdpercent/lyracyst.png?branch=master)](https://travis-ci.org/weirdpercent/lyracyst)[![
|
8
|
+
[![Build Status](https://travis-ci.org/weirdpercent/lyracyst.png?branch=master)](https://travis-ci.org/weirdpercent/lyracyst)[![Gem Version](https://badge.fury.io/rb/lyracyst.svg)](http://badge.fury.io/rb/lyracyst)[![Dependency Status](https://gemnasium.com/weirdpercent/lyracyst.png)](https://gemnasium.com/weirdpercent/lyracyst)
|
9
9
|
|
10
10
|
A powerful word search tool for writers of all kinds.
|
11
11
|
|
12
12
|
### Synopsis
|
13
13
|
|
14
|
-
Search [Wordnik](http://www.wordnik.com/), [thesaurus.altervista.org](http://thesaurus.altervista.org/), and [Arpabet](http://en.wikipedia.org/wiki/Arpabet) from the command line.
|
14
|
+
Search [Wordnik](http://www.wordnik.com/), [thesaurus.altervista.org](http://thesaurus.altervista.org/), and [Arpabet](http://en.wikipedia.org/wiki/Arpabet) from the command line. Get API search keys as follows:
|
15
|
+
Altervista - http://thesaurus.altervista.org/mykey
|
16
|
+
Wordnik - http://developer.wordnik.com/
|
17
|
+
Put them in environment variables THESAURUS and WORDNIK respectively. Adding these to .bashrc or .zshrc is the easiest way.
|
15
18
|
|
16
19
|
### Features
|
17
20
|
|
@@ -19,8 +22,7 @@ Search [Wordnik](http://www.wordnik.com/), [thesaurus.altervista.org](http://the
|
|
19
22
|
- Definitions from Wordnik
|
20
23
|
- Rhymes from arpabet.heroku.com
|
21
24
|
- Related words from thesaurus.altervista.org
|
22
|
-
-
|
23
|
-
- Export wordlists matching search criteria
|
25
|
+
- JSON parsing
|
24
26
|
|
25
27
|
### Usage
|
26
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lyracyst
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Prentice
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|