promper 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/promper.rb ADDED
@@ -0,0 +1,39 @@
1
+ require 'promper/version'
2
+ require './gab_tree'
3
+ require './gab_tree_processor'
4
+
5
+ class Promper
6
+ def initialize
7
+
8
+ end
9
+
10
+ def go_boy
11
+ puts "Ruff ruff ruff!\nMy name is promper! I'm an energetic dog!!!"
12
+ while true
13
+ phrase = prompt("What are we looking for? (Enter nothing to quit)")
14
+ if phrase == ''
15
+ break
16
+ end
17
+ result = search(phrase)
18
+ puts "\nI think I found it!\n"
19
+ pp(result)
20
+ end
21
+ end
22
+
23
+ def prompt(phrase = '')
24
+ puts "\n*drool drool drool*\n#{phrase}"
25
+ phrase = gets.chomp
26
+ end
27
+
28
+ def search(phrase)
29
+ tree = GabTree.new(phrase,
30
+ phoneme_convert: true, match_criteria: LooseMatch.new)
31
+ processor = GabTreeProcessor.new(tree.root_node)
32
+ tree.iterate_until_finished
33
+ processor.result
34
+ end
35
+
36
+ def clipboard_copy(result)
37
+ IO.popen("pbcopy", "w") { |pipe| pipe.puts result }
38
+ end
39
+ end
@@ -0,0 +1,3 @@
1
+ class Promper
2
+ VERSION = "0.1.3"
3
+ end
data/promper.gemspec ADDED
@@ -0,0 +1,60 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'promper/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "promper"
8
+ spec.version = Promper::VERSION
9
+ spec.authors = ["prettycities"]
10
+ spec.email = ["mrcye@gmail.com"]
11
+
12
+ spec.summary = %q{Extract similar sounding phoneme constructions from English word(s).}
13
+ spec.description = %q{This gem takes English words, converts them to their IPA equivalent, and then uses a tree data structure to query a database and identify other English words that have a similar phonetic makeup. It uses RubyTree which has the following license:
14
+
15
+ "RubyTree is licensed under the BSD license.
16
+
17
+ Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Anupam Sengupta (anupamsg@gmail.com).
18
+
19
+ All rights reserved.
20
+
21
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
22
+
23
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
24
+
25
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
26
+
27
+ Neither the name of the organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
28
+
29
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30
+
31
+ IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
32
+
33
+ It also uses string_to_ipa which includes the following license from Carnegie Mellon University:
34
+
35
+ "The Carnegie Mellon University Pronouncing Dictionary was used in the creation of this gem. Their copyright notice follows:
36
+
37
+ Copyright (C) 1993-2015 Carnegie Mellon University. All rights reserved.
38
+
39
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
40
+
41
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. The contents of this file are deemed to be source code
42
+
43
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
44
+
45
+ This work was supported in part by funding from the Defense Advanced Research Projects Agency, the Office of Naval Research and the National Science Foundation of the United States of America, and by member companies of the Carnegie Mellon Sphinx Speech Consortium. We acknowledge the contributions of many volunteers to the expansion and improvement of this dictionary.
46
+
47
+ THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY 'AS IS' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."}
48
+ spec.homepage = ""
49
+ spec.license = "MIT"
50
+
51
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
52
+ spec.bindir = "exe"
53
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
54
+ spec.require_paths = ["lib"]
55
+
56
+ spec.add_development_dependency "bundler", "~> 1.12"
57
+ spec.add_development_dependency "rake", "~> 10.0"
58
+ spec.add_runtime_dependency "rubytree"
59
+ spec.add_runtime_dependency "string_to_ipa"
60
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: promper
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ platform: ruby
6
+ authors:
7
+ - prettycities
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubytree
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: string_to_ipa
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: |-
70
+ This gem takes English words, converts them to their IPA equivalent, and then uses a tree data structure to query a database and identify other English words that have a similar phonetic makeup. It uses RubyTree which has the following license:
71
+
72
+ "RubyTree is licensed under the BSD license.
73
+
74
+ Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Anupam Sengupta (anupamsg@gmail.com).
75
+
76
+ All rights reserved.
77
+
78
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
79
+
80
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
81
+
82
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
83
+
84
+ Neither the name of the organization nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
85
+
86
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
87
+
88
+ IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
89
+
90
+ It also uses string_to_ipa which includes the following license from Carnegie Mellon University:
91
+
92
+ "The Carnegie Mellon University Pronouncing Dictionary was used in the creation of this gem. Their copyright notice follows:
93
+
94
+ Copyright (C) 1993-2015 Carnegie Mellon University. All rights reserved.
95
+
96
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
97
+
98
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. The contents of this file are deemed to be source code
99
+
100
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
101
+
102
+ This work was supported in part by funding from the Defense Advanced Research Projects Agency, the Office of Naval Research and the National Science Foundation of the United States of America, and by member companies of the Carnegie Mellon Sphinx Speech Consortium. We acknowledge the contributions of many volunteers to the expansion and improvement of this dictionary.
103
+
104
+ THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY 'AS IS' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
105
+ email:
106
+ - mrcye@gmail.com
107
+ executables: []
108
+ extensions: []
109
+ extra_rdoc_files: []
110
+ files:
111
+ - ".gitignore"
112
+ - CODE_OF_CONDUCT.md
113
+ - Gemfile
114
+ - LICENSE
115
+ - LICENSE.txt
116
+ - README.md
117
+ - Rakefile
118
+ - bin/console
119
+ - bin/setup
120
+ - lib/db.rb
121
+ - lib/db/master.yml
122
+ - lib/gab_tree.rb
123
+ - lib/gab_tree_processor.rb
124
+ - lib/matching.rb
125
+ - lib/promper.rb
126
+ - lib/promper/version.rb
127
+ - promper.gemspec
128
+ homepage: ''
129
+ licenses:
130
+ - MIT
131
+ metadata: {}
132
+ post_install_message:
133
+ rdoc_options: []
134
+ require_paths:
135
+ - lib
136
+ required_ruby_version: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - ">="
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ requirements: []
147
+ rubyforge_project:
148
+ rubygems_version: 2.6.4
149
+ signing_key:
150
+ specification_version: 4
151
+ summary: Extract similar sounding phoneme constructions from English word(s).
152
+ test_files: []