ImpUnit 0.1.6 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ImpUnit/version.rb +1 -1
  3. data/lib/ImpUnit.rb +478 -22
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc512dcb7a3c90ef3070530cb3b4287db13160cfffb9dad82687a68e2a77a573
4
- data.tar.gz: 25e3a825d4c29701aab5d93924bc944b0a53ca4e451d5d34202c8496f2e3d9ba
3
+ metadata.gz: e000b6a04d65727914634c2b3bb7592be409fb5b6a3973f6dc5f5c3be01bed49
4
+ data.tar.gz: de6e21d3c3678fc228ffe6d214b6c2fe168efa73f91eb0d4030e03adb4877847
5
5
  SHA512:
6
- metadata.gz: 12c4a6144c3df1f1d46c26d5f675814318e49d3c2cc92545925775c65aa03c7dd2232e701f1a8f3c0eeef33180c6c2fb4ec625d6cdcb158912c2954664e175b9
7
- data.tar.gz: 4c7357a9bfaead6b9bbdddcac249e6ab9b3afc6f81946683b993ebf6b799faedac141c7d37ecc1e0c21b196e584752f792ee33b601d9d91e1436fc6a4184dc87
6
+ metadata.gz: 0512b53dd3d93a2d1ef05312fb8e8845982a9779e60ce0baac33ae84c1f029dd73f160e1aefd81ea2156249656c734552d1fca229d4f8bffb19c8013143be087
7
+ data.tar.gz: 8d3d565198131b193866d58851bcf14a874f17354baa6b263060fa239836efbb921220cd0df119c9fdc4fc8b0c33501b80f020ef2da37eacb5421b1b1a6a0f66
@@ -1,3 +1,3 @@
1
1
  module ImpUnit
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/ImpUnit.rb CHANGED
@@ -2,6 +2,17 @@ require "ImpUnit/version"
2
2
 
3
3
  module ImpUnit
4
4
  class Error < StandardError; end
5
+
6
+ # class options
7
+ # def self.imp_choose
8
+ # require "decisiontree"
9
+
10
+
11
+ # end
12
+
13
+ # def self.manual
14
+ # end
15
+ # end
5
16
 
6
17
  class MainAI
7
18
  def self.seed
@@ -42,19 +53,160 @@ module ImpUnit
42
53
  end
43
54
  end
44
55
 
45
- # Caution: Highly Experimental. This treats naive similarly to a dynamic website.
46
- class Language
56
+ # Fraponic language model of Naive Bayes. See: https://lwflouisa.github.io/FraponicConlang
57
+ class ActiveBayes
47
58
  def self.fraponic_standard
48
- end
59
+ # Create an archive of the data.
60
+ data_archive = File.read("data/memory/data_archive.txt").strip.to_s
61
+
62
+ # Create a label for the model.
63
+ print "Label >> "; label = gets.chomp
64
+
65
+ # Choose a word for that label.
66
+ print "Word >> "; word = gets.chomp
67
+
68
+ # Create a training example from label and word.
69
+ new_model = "a.train(:#{label}, '#{word}', 'word')"
70
+
71
+ # Assign new baysian model with data archive and new model.
72
+ baysian_model = "number = 0
73
+
74
+ print "<< "; input = gets.chomp
75
+
76
+ size_limit = input.size.to_i
77
+
78
+ size_limit.times do
79
+ require 'naive_bayes'
80
+
81
+ a = NaiveBayes.new(:honorific,
82
+ :greeting,
83
+ :personal_pronoun,
84
+ :offensive_pronoun,
85
+ :word_gender,
86
+ :noun,
87
+ :adjective,
88
+ :conjunction,
89
+ :verb,
90
+ :adverb,
91
+ :punctuation,
92
+ )
93
+
94
+ a.db_filepath = 'data/memory/archive.nb'
95
+
96
+ #{data_archive}
97
+ #{new_model}
98
+
99
+ print '<< '
100
+ b = input[number]
101
+
102
+ puts a.classify(*b)
103
+
104
+ number = number + 1
105
+ end"
106
+
107
+ # Create active archive of data.
108
+ open("data/memory/data_archive.txt", "w") { |f|
109
+ f.puts "#{data_archive}"
110
+ f.puts "#{new_model}"
111
+ }
49
112
 
50
- def self.fraponic_request
113
+ open("loader.rb", "w") { |f|
114
+ f.puts baysian_model
115
+ }
51
116
  end
52
117
 
53
118
  def self.loader
119
+ system("ruby loader.rb")
54
120
  end
55
121
  end
56
122
 
57
- # Points to specific subroutines.
123
+ # Bleeding edge
124
+ class ObjectColor
125
+ def self.what_object
126
+ input = File.read("data/object/object_chart.txt").split(" ")
127
+
128
+ number = 0
129
+
130
+ size_limit = input.size.to_i
131
+
132
+ # Estimate each word in a sentence from a label.
133
+ size_limit.times do
134
+ require 'naive_bayes'
135
+
136
+ object = NaiveBayes.new(:person, :place, :thing)
137
+
138
+ # Trains on apple colors.
139
+ object.train(:person, "person", "word")
140
+ object.train(:place, "place", "word")
141
+ object.train(:thing, "thing", "word")
142
+
143
+ b = input[number]
144
+
145
+ puts "Results >> #{object.classify(*b)}"
146
+
147
+ sleep(1)
148
+
149
+ number = number + 1
150
+ end
151
+ end
152
+
153
+ def self.what_color
154
+ input = File.read("data/colors/color_chart.txt").split(" ")
155
+
156
+ number = 0
157
+
158
+ size_limit = input.size.to_i
159
+
160
+ # Estimate each word in a sentence from a label.
161
+ size_limit.times do
162
+ require 'naive_bayes'
163
+
164
+ color = NaiveBayes.new(:red, :green, :yellow)
165
+
166
+ # Trains on apple colors.
167
+ color.train(:red, "red", "word")
168
+ color.train(:green, "green", "word")
169
+ color.train(:yellow, "yellow", "word")
170
+
171
+ b = input[number]
172
+
173
+ puts "Results >> #{color.classify(*b)}"
174
+
175
+ sleep(1)
176
+
177
+ number = number + 1
178
+ end
179
+ end
180
+
181
+ def self.what_action
182
+ input = File.read("data/actions/action_chart.txt").split(" ")
183
+
184
+ number = 0
185
+
186
+ size_limit = input.size.to_i
187
+
188
+ # Estimate each word in a sentence from a label.
189
+ size_limit.times do
190
+ require 'naive_bayes'
191
+
192
+ action = NaiveBayes.new(:eat, :toss)
193
+
194
+ # Trains on apple colors.
195
+ action.train(:eat, "eat", "word")
196
+ action.train(:toss, "toss", "word")
197
+
198
+ b = input[number]
199
+
200
+ puts "Results >> #{action.classify(*b)}"
201
+
202
+ sleep(1)
203
+
204
+ number = number + 1
205
+ end
206
+ end
207
+ end
208
+
209
+ # Points to specific SimpleSearch.
58
210
  class SimpleSearch
59
211
 
60
212
  # ImpUnit::SimpleSearch.standard
@@ -315,13 +467,14 @@ module ImpUnit
315
467
  local_name = File.read("data/usr_identity/local_name.txt").strip.to_s
316
468
 
317
469
  # Create XML tags
318
- salut = " <salut>Hello</salut>"
319
- ejento = " <ejento>#{agent_name}</ejento>"
320
- rikusuto = " <rikusuto>#{request_type}</rikusuto>"
321
- atemu = " <atemu>#{item}</atemu>"
322
- nitote = " <nitote>for</nitote>"
323
- kara = " <kara>from</kara>"
324
- yuza = " <yuza>#{user_name}</yuza>"
470
+ salut = "Hello"
471
+ ejento = " #{agent_name}"
472
+ rikusuto = " #{request_type}"
473
+ atemu = " #{item}"
474
+ nitote = " for"
475
+ kara = " from"
476
+ yuza = " #{user_name}"
477
+ lieu = " #{local_name}?"
325
478
 
326
479
  conjucate = [nitote, kara]
327
480
  consign = conjucate.sample
@@ -329,17 +482,320 @@ module ImpUnit
329
482
  user_location = [yuza, lieu]
330
483
  usign = user_location[0]
331
484
 
332
- open("index.xml", "w") { |f|
333
- f.puts xml_header
334
- f.puts topic_header
335
- f.puts salut
336
- f.puts ejento
337
- f.puts rikusuto
338
- f.puts atemu
339
- f.puts consign
340
- f.puts usign
341
- f.puts topic_bottom
485
+ system("date +'%Y-%d-%m' > date.txt")
486
+
487
+ date = File.read("date.txt").strip.to_s
488
+
489
+ open("#{date}-update.md", "w") { |f|
490
+ f.puts "---"
491
+ f.puts "title: '#{date} Update'"
492
+ f.puts "layout: post"
493
+ f.puts "---"
494
+ f.puts "#{salut} #{ejento} #{rikusuto} #{atemu} #{consign} #{usign}"
342
495
  }
343
496
  end
344
497
  end
498
+
499
+ class BotWings
500
+ def self.reset_evo
501
+ reset_usr_input = 0
502
+
503
+ open("data/number/input.txt", "w") { |f|
504
+ f.puts reset_usr_input
505
+ }
506
+ end
507
+
508
+ def self.use_form
509
+ system("tts 'Form status: Suitable...', 'en'")
510
+
511
+ sleep(3)
512
+
513
+ # Detect bot form
514
+ # bot_choice = File.read("data/bot_input/input.txt").strip.to_i
515
+ # bot_wings = File.readlines("data/bot_shape/wings.txt")
516
+
517
+ # Form conditional
518
+ # if bot form is decision tree
519
+ # elsif bot form is naive bayes
520
+ # elsif bot form is biometrics
521
+ # elsif bot form is "infinite learning algorithm"
522
+
523
+ abort
524
+ end
525
+
526
+ def self.reshape
527
+ system("clear")
528
+
529
+ model_type = File.read("data/model/model_type.txt").strip
530
+
531
+ bot_choice = File.read("data/bot_input/input.txt").strip.to_i
532
+ number = File.read("data/number/input.txt").strip.to_i
533
+
534
+ usr_wings = File.readlines("data/usr_shape/wings.txt")
535
+ bot_wings = File.readlines("data/bot_shape/wings.txt")
536
+
537
+ current_wingset = usr_wings[number]
538
+ current_botwings = bot_wings[bot_choice]
539
+
540
+ system("tts 'The user #{model_type} model has: #{current_wingset}', 'en'")
541
+ system("tts 'The bot #{model_type} model has: #{current_botwings}', 'en'")
542
+
543
+ if current_wingset == current_botwings
544
+ ImpUnit::BotWings.use_form
545
+
546
+ sleep(3)
547
+
548
+ about
549
+ # ImpUnit::BotWings.reset_evo
550
+ else
551
+ # system("tts 'Form status: Changing form...', 'en'")
552
+
553
+ puts "Form status: Changing form..."
554
+
555
+ sleep(3)
556
+
557
+ new_value = number + 1
558
+
559
+ open("data/number/input.txt", "w") { |f|
560
+ f.puts new_value
561
+ }
562
+ end
563
+
564
+ ImpUnit::BotWings.reshape
565
+ end
566
+ end
567
+
568
+ class Spices
569
+
570
+ def self.tumeric
571
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
572
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
573
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
574
+
575
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
576
+
577
+ print spoon_size.sample
578
+ print spoon_type.sample
579
+ puts " turmeric"
580
+ end
581
+
582
+ def self.cumin
583
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
584
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
585
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
586
+
587
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
588
+
589
+ print spoon_size.sample
590
+ print spoon_type.sample
591
+ puts " cumin"
592
+ end
593
+
594
+ def self.cayenne
595
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
596
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
597
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
598
+
599
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
600
+
601
+ print spoon_size.sample
602
+ print spoon_type.sample
603
+ puts " cayenne"
604
+ end
605
+
606
+ def self.chilly_powder
607
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
608
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
609
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
610
+
611
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
612
+
613
+ print spoon_size.sample
614
+ print spoon_type.sample
615
+ puts " chilly powder"
616
+ end
617
+
618
+ def self.crushed_peppers
619
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
620
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
621
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
622
+
623
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
624
+
625
+ print spoon_size.sample
626
+ print spoon_type.sample
627
+ puts " crushed peppers"
628
+ end
629
+
630
+ def self.garlic_powder
631
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
632
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
633
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
634
+
635
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
636
+
637
+ print spoon_size.sample
638
+ print spoon_type.sample
639
+ puts " garlic powder"
640
+ end
641
+
642
+ def self.onion_powder
643
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
644
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
645
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
646
+
647
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
648
+
649
+ print spoon_size.sample
650
+ print spoon_type.sample
651
+ puts " onion powder"
652
+ end
653
+
654
+ def self.cocao_powder
655
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
656
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
657
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
658
+
659
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
660
+
661
+ print spoon_size.sample
662
+ print spoon_type.sample
663
+ puts " cocao powder"
664
+ end
665
+
666
+ def self.cinnamon
667
+ spoon_size = [ "1/8 ", "1/4 ", "1/2 ", "1 ",
668
+ "1 1/8 ", "1 1/4th ", "1 1/2 ", "2 ",
669
+ "2 1/8 ", "2 1/4th ", "2 1/2 ", "3 "]
670
+
671
+ spoon_type = ["teaspoon ", "tablespoon ", "cup ", "shotglass "]
672
+
673
+ print spoon_size.sample
674
+ print spoon_type.sample
675
+ puts " cinnamon"
676
+ end
677
+ end
345
678
  end
679
+
680
+ #module Bianca
681
+ #class SmallTalk
682
+ #def self.name
683
+ #end
684
+
685
+ #def self.pets
686
+ #end
687
+
688
+ #def self.hobbies
689
+ #end
690
+
691
+ #def self.jobs
692
+ #end
693
+
694
+ #def self.skills
695
+ #end
696
+
697
+ #def self.weather
698
+ #end
699
+
700
+ #def self.operate
701
+ #end
702
+ #end
703
+ #end
704
+
705
+ ## Measuring the distance between objects and size of objects in space.
706
+ #module SpatialRelationships
707
+ #class Error < StandardError; end
708
+
709
+ #class Static_Perimeters
710
+
711
+ # The objects within the space.
712
+ #def positive_perimeters
713
+ # Base radius of static objects.
714
+ #base_radius = 2500
715
+
716
+ # Specfic multipliers for Earth index based objects.
717
+ #base_two = 2
718
+ #base_fro = 4
719
+ #base_six = 6
720
+ #base_eit = 8
721
+
722
+ # Size of specific objects.
723
+ #size_of_planets = base_radius ** base_fro
724
+ #size_of_moons = base_radius ** base_two
725
+ #size_of_stars = base_radius ** base_six
726
+ #size_of_blackholes = base_radius ** base_eit
727
+
728
+ # Total output sizes of specific objects.
729
+ #puts "The size of the planets is #{size_of_planets} radius."; sleep(3)
730
+ #puts "The size of the moons is #{size_of_moons} radius."; sleep(3)
731
+ #puts "The size of the stars is #{size_of_stars} radius."; sleep(3)
732
+ #puts "The size of a blackhole is #{size_of_blackholes} radius."; sleep(3)
733
+ #end
734
+
735
+ # Space between the objects.
736
+ #def negative_perimeters
737
+ # Base distance between objects.
738
+ #base_distance = 1_000_000_000
739
+
740
+ # Estimated divider between specific objects to base distance.
741
+ #space_between_planets = 43.8
742
+ #space_between_moons = 14.6
743
+ #space_between_stars = 876
744
+ #space_between_blackholes = 2628
745
+
746
+ # Minimum distance between objects.
747
+ #planet_distance = base_distance / space_between_planets
748
+ #moon_distance = base_distance / space_between_moons
749
+ #star_distance = base_distance / space_between_stars
750
+ #blackhole_distance = base_distance / space_between_blackholes
751
+
752
+ # Actual distance between objects
753
+ #actual_planets = planet_distance * 10
754
+ #actual_moons = moon_distance * 10
755
+ #actual_stars = star_distance * 10
756
+ #actual_blackholes = blackhole_distance * 10
757
+
758
+ # The output results of distance between objects.
759
+ #puts "The distance between planets is #{actual_planets} miles."; sleep(3)
760
+ #puts "The distance between moons is #{actual_moons} miles."; sleep(3)
761
+ #puts "The distance between stars is #{actual_stars} miles."; sleep(3)
762
+ #puts "The distance between blackholes is #{actual_blackholes} miles."; sleep(3)
763
+ #end
764
+
765
+ #end
766
+
767
+ # Changing perimeters
768
+ #class Dynamic_Perimeters
769
+
770
+ # The objects within the space.
771
+ #def positive_perimeters
772
+ #spaceship = File.read("data/dynamic/positive_perimenters/spaceship_size.txt").strip.to_i
773
+ #space_station = spaceship * 200
774
+ #satalite = space_station / 10
775
+
776
+ #puts "The total size of the space shuttle is #{spaceship} feet."; sleep(3)
777
+ #puts "The total size of the space station is #{space_station} feet."; sleep(3)
778
+ #puts "The total size of the satalite is #{satalite} feet."; sleep(3)
779
+ #end
780
+
781
+ # Space between the objects.
782
+ #def negative_perimeters
783
+ #base_multiplier = 10
784
+
785
+ # Minimum space between objects.
786
+ #space_between_spaceships = File.read("data/dynamic/negative_perimeters/space_between_spaceships.txt").strip.to_i
787
+ #space_between_station = File.read("data/dynamic/negative_perimeters/space_between_station.txt").strip.to_i
788
+ #space_between_satalite = File.read("data/dynamic/negative_perimeters/space_between_satalite.txt").strip.to_i
789
+
790
+ # Actual space between objects
791
+ #actual_spaceship_distance = space_between_spaceships * base_multiplier
792
+ #actual_station_distance = space_between_station * base_multiplier
793
+ #actual_satalite_distance = space_between_satalite * base_multiplier
794
+
795
+ #puts "The minimum space between shuttles is #{actual_spaceship_distance} feet."; sleep(3)
796
+ #puts "The minimum space between stations is #{actual_station_distance} feet."; sleep(3)
797
+ #puts "The minimum space between satalites is #{actual_satalite_distance} feet."; sleep(3)
798
+ #end
799
+
800
+ #end
801
+ #end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ImpUnit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LWFlouisa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-14 00:00:00.000000000 Z
11
+ date: 2021-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler