meiou 0.1.5 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,71 @@
1
+ require 'astronomy'
2
+
3
+ module ASTRO
4
+
5
+ @@ASTRO = Astronomy::Information.new
6
+
7
+ def self.search k
8
+ h = {}
9
+ @@ASTRO.search(k).each { |e| h[e["name"]] = e["description"] }
10
+ return h
11
+ end
12
+
13
+ @@C = Hash.new { |h,k| h[k] = @@ASTRO.topics(k) }
14
+
15
+ def self.[] k
16
+ @@C[k]
17
+ end
18
+
19
+ def self.keys
20
+ @@C.keys
21
+ end
22
+
23
+ def self.to_h
24
+ h = Hash.new { |h,k| h[k] = {} }
25
+ ASTRO.keys.each { |e| ASTRO[e].each { |ee| h[e][ee['name']] = ee["description"] } }
26
+ return h
27
+ end
28
+
29
+ def self.to_a
30
+ a = []
31
+ ASTRO.to_h.each_pair { |k,v| v.each_pair { |kk,vv| a << vv } }
32
+ return a
33
+ end
34
+
35
+ def self.to_s
36
+ ASTRO.to_a.join("\n\n")
37
+ end
38
+
39
+ @@ASTRO.categories.each { |e| @@C[e] }
40
+
41
+ def self.zodiac
42
+ [ :cancer,:leo,:capricorn,:gemini,:aquarius,:libra,:taurus,:aries,:pisces ]
43
+ end
44
+ def self.movements
45
+ [ :rising, :falling, 'at rest' ]
46
+ end
47
+ def self.signs
48
+ [ :sun, :moon ]
49
+ end
50
+ def self.orbits
51
+ [ "in retrograde", "in procession", "at equinox", "at perogy", "at apogy" ]
52
+ end
53
+ def self.alignments
54
+ [:parallel,:tangential,:perpendicular]
55
+ end
56
+ def self.planets
57
+ [:mercury,:venus,:mars,:vesta,:ceres,:jupiter,:saturn,:uranus,:neptune,:pluto]
58
+ end
59
+ def self.init!
60
+ File.open("books/astronomy.txt",'w') { |f| f.write(ASTRO.to_s) }
61
+ end
62
+
63
+ end
64
+
65
+ module Meiou
66
+ def self.astronomy
67
+ ASTRO
68
+ end
69
+ end
70
+
71
+ Meiou.init(:astro) { |h| ASTRO.init! }
@@ -0,0 +1,21 @@
1
+ require 'gemoji'
2
+
3
+ module EMOJI
4
+
5
+ def self.[] k
6
+ Emoji.find_by_alias(k.to_s)
7
+ end
8
+
9
+ def self.translate i
10
+ a = []
11
+ Meiou.extract(i) { |e| if EMOJI[e[:word]]; a << EMOJI[e[:word]].raw; else; a << e[:word]; end }
12
+ return a
13
+ end
14
+ end
15
+
16
+
17
+ module Meiou
18
+ def self.simplify i
19
+ EMOJI.translate i
20
+ end
21
+ end
data/lib/meiou/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meiou
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.8"
5
5
  end
data/lib/meiou.rb CHANGED
@@ -36,6 +36,10 @@ require_relative "meiou/version"
36
36
 
37
37
  require_relative "meiou/wiki"
38
38
 
39
+ require_relative "meiou/emoji"
40
+
41
+ require_relative "meiou/astronomy"
42
+
39
43
  require_relative "meiou/dictionary"
40
44
 
41
45
  require_relative "meiou/word"
data/meiou.gemspec CHANGED
@@ -37,6 +37,8 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency "tokenizer"
38
38
  spec.add_dependency "textmood"
39
39
  spec.add_dependency "tokipona"
40
+ spec.add_dependency "astronomy"
41
+ spec.add_dependency "gemoji"
40
42
  # For more information and examples about making a new gem, check out our
41
43
  # guide at: https://bundler.io/guides/creating_gem.html
42
44
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meiou
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson
@@ -94,6 +94,34 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: astronomy
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: gemoji
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
97
125
  description: A wrapper for for wikipedia entries, curated txt files, and other sources
98
126
  of knowledge.
99
127
  email:
@@ -138,11 +166,14 @@ files:
138
166
  - books/Doctor_and_Patient.txt
139
167
  - books/Roman_Farm_Management.txt
140
168
  - books/Social_Organization.txt
169
+ - books/astronomy.txt
141
170
  - books/interpretation_of_dreams.txt
142
171
  - books/the_prince.txt
143
172
  - lib/meiou.rb
173
+ - lib/meiou/astronomy.rb
144
174
  - lib/meiou/book.rb
145
175
  - lib/meiou/dictionary.rb
176
+ - lib/meiou/emoji.rb
146
177
  - lib/meiou/mood.rb
147
178
  - lib/meiou/tokipona.rb
148
179
  - lib/meiou/version.rb