linguistics_latin_tense_block 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +12 -0
- data/lib/linguistics_latin_tense_block/tense_block/null_tense_block.rb +12 -0
- data/lib/linguistics_latin_tense_block/tense_block/vector_resolution_delegate.rb +89 -0
- data/lib/linguistics_latin_tense_block/tense_block.rb +53 -0
- data/lib/linguistics_latin_tense_block/utils/triplicate_and_pluralize_formatters.rb +27 -0
- data/lib/linguistics_latin_tense_block/version.rb +3 -0
- data/lib/linguistics_latin_tense_block.rb +7 -0
- data/linguistics_latin_tense_block.gemspec +24 -0
- data/test/tense_block_test.rb +6 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9f346cf31bde46e63bd91e47d694c6e3923803cf
|
4
|
+
data.tar.gz: f43d05321445247e137be1ce96245da4d5159676
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: daacfe5f21084a294c21f74ab1b2d92c6d97280c39eb8cf9f63bb6d3a35d51c87c3d255f9a81599b56555c732183e68b7757383004dbcb1f640c6cecfc01ceef
|
7
|
+
data.tar.gz: fbfa90c9891f241daa696b507b80d50fe08b42388e3b535a4b43aa51f66852b32b7e7cbc1e0eb8903d52edf93aa1dd230e0013ba99732645b2c5f378e66d4d4a
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Steven G. Harms
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# LinguisticsLatinTenseBlock
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'linguistics_latin_tense_block'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install linguistics_latin_tense_block
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/linguistics_latin_tense_block/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require "rake/testtask"
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
task :default => :test
|
5
|
+
|
6
|
+
Rake::TestTask.new do |t|
|
7
|
+
t.ruby_opts = [ '-rminitest/autorun', '-rminitest/pride', '-rlinguistics_latin_tense_block' ]
|
8
|
+
t.libs << "test"
|
9
|
+
t.test_files = FileList['test/*test*.rb']
|
10
|
+
t.verbose = true
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class TenseBlock
|
5
|
+
class VectorResolutionDelegate
|
6
|
+
def initialize(results)
|
7
|
+
@results = results
|
8
|
+
end
|
9
|
+
|
10
|
+
def first_person_singular_number
|
11
|
+
@results[0]
|
12
|
+
end
|
13
|
+
|
14
|
+
def singular_number_first_person
|
15
|
+
@results[0]
|
16
|
+
end
|
17
|
+
|
18
|
+
def second_person_singular_number
|
19
|
+
@results[1]
|
20
|
+
end
|
21
|
+
|
22
|
+
def singular_number_second_person
|
23
|
+
@results[1]
|
24
|
+
end
|
25
|
+
|
26
|
+
def third_person_singular_number
|
27
|
+
@results[2]
|
28
|
+
end
|
29
|
+
|
30
|
+
def third_person_singular_number
|
31
|
+
@results[2]
|
32
|
+
end
|
33
|
+
|
34
|
+
def singular_number_third_person
|
35
|
+
@results[2]
|
36
|
+
end
|
37
|
+
|
38
|
+
def first_person_plural_number
|
39
|
+
@results[3]
|
40
|
+
end
|
41
|
+
|
42
|
+
def plural_number_first_person
|
43
|
+
@results[3]
|
44
|
+
end
|
45
|
+
|
46
|
+
def second_person_plural_number
|
47
|
+
@results[4]
|
48
|
+
end
|
49
|
+
|
50
|
+
def plural_number_second_person
|
51
|
+
@results[4]
|
52
|
+
end
|
53
|
+
|
54
|
+
def third_person_plural_number
|
55
|
+
@results[5]
|
56
|
+
end
|
57
|
+
|
58
|
+
def plural_number_third_person
|
59
|
+
@results[5]
|
60
|
+
end
|
61
|
+
|
62
|
+
def first_person
|
63
|
+
[ @results[0], @results[3] ]
|
64
|
+
end
|
65
|
+
|
66
|
+
def second_person
|
67
|
+
[ @results[1], @results[4] ]
|
68
|
+
end
|
69
|
+
|
70
|
+
def third_person
|
71
|
+
[ @results[2], @results[5] ]
|
72
|
+
end
|
73
|
+
|
74
|
+
def singular_number
|
75
|
+
[ @results[0],
|
76
|
+
@results[1],
|
77
|
+
@results[2] ]
|
78
|
+
end
|
79
|
+
|
80
|
+
def plural_number
|
81
|
+
[ @results[3],
|
82
|
+
@results[4],
|
83
|
+
@results[5] ]
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
module Linguistics
|
2
|
+
module Latin
|
3
|
+
module Verb
|
4
|
+
class TenseBlock
|
5
|
+
include Linguistics::Latin::Phonographia
|
6
|
+
|
7
|
+
extend Forwardable
|
8
|
+
|
9
|
+
def_delegators :@results, :[], :empty?, :length, :to_a, :each
|
10
|
+
def_delegators :@resolver,
|
11
|
+
:first_person_singular_number, :singular_number_first_person,
|
12
|
+
:second_person_singular_number, :singular_number_second_person,
|
13
|
+
:third_person_singular_number, :singular_number_third_person,
|
14
|
+
|
15
|
+
:first_person_plural_number, :plural_number_first_person,
|
16
|
+
:second_person_plural_number, :plural_number_second_person,
|
17
|
+
:third_person_plural_number, :plural_number_third_person,
|
18
|
+
|
19
|
+
:first_person, :second_person, :third_person,
|
20
|
+
|
21
|
+
:singular_number, :plural_number
|
22
|
+
|
23
|
+
attr_reader :meaning, :results
|
24
|
+
|
25
|
+
def initialize(r, opts={})
|
26
|
+
@results = Array(r).map{ |v| fix_macrons(v) }
|
27
|
+
@meaning = opts[:meaning] || ""
|
28
|
+
@resolver = VectorResolutionDelegate.new(@results)
|
29
|
+
end
|
30
|
+
|
31
|
+
def to_s
|
32
|
+
to_a.to_s
|
33
|
+
end
|
34
|
+
|
35
|
+
def wordless?
|
36
|
+
!@results.find{ |r| r =~ /\w/ }
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_json(*a)
|
40
|
+
{
|
41
|
+
'json_class' => self.class.name,
|
42
|
+
'data' => @results.map{|i| i.to_json}
|
43
|
+
}.to_json(*a)
|
44
|
+
end
|
45
|
+
|
46
|
+
def TenseBlock.json_create(o)
|
47
|
+
new(o['data'])
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
module Linguistics
|
3
|
+
module Latin
|
4
|
+
module Verb
|
5
|
+
class LatinVerb
|
6
|
+
module Formatters
|
7
|
+
class TriplicateAndPluralizeFormatters
|
8
|
+
def self.pluralize_participial_listing(participle)
|
9
|
+
x = triplicate_and_genderize(participle)
|
10
|
+
x.sub!(/us,/, 'ī,' )
|
11
|
+
x.sub!(/a,/, 'ae,')
|
12
|
+
x.sub!(/um.*$/, 'a' )
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.triplicate_and_genderize(s)
|
16
|
+
stem = s.sub(/^(.*)um$/,"\\1")
|
17
|
+
[ stem + 'us',
|
18
|
+
stem + 'a',
|
19
|
+
s
|
20
|
+
].join(', ')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
require 'linguistics_latin'
|
3
|
+
require 'linguistics_latin_tense_block/version'
|
4
|
+
require 'linguistics_latin_tense_block/utils/triplicate_and_pluralize_formatters.rb'
|
5
|
+
require 'linguistics_latin_tense_block/tense_block'
|
6
|
+
require 'linguistics_latin_tense_block/tense_block/null_tense_block'
|
7
|
+
require 'linguistics_latin_tense_block/tense_block/vector_resolution_delegate'
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'linguistics_latin_tense_block/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "linguistics_latin_tense_block"
|
8
|
+
spec.version = LinguisticsLatinTenseBlock::VERSION
|
9
|
+
spec.authors = ["Steven G. Harms"]
|
10
|
+
spec.email = ["steven.harms@gmail.com"]
|
11
|
+
spec.summary = %q{Abstraction for extracting person / number combinations from an abstraction (TenseBlock) holding a voice/mood/tense collection}
|
12
|
+
spec.homepage = ""
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency "linguistics_latin"
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: linguistics_latin_tense_block
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Steven G. Harms
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-07-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: linguistics_latin
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.6'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- steven.harms@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/linguistics_latin_tense_block.rb
|
68
|
+
- lib/linguistics_latin_tense_block/tense_block.rb
|
69
|
+
- lib/linguistics_latin_tense_block/tense_block/null_tense_block.rb
|
70
|
+
- lib/linguistics_latin_tense_block/tense_block/vector_resolution_delegate.rb
|
71
|
+
- lib/linguistics_latin_tense_block/utils/triplicate_and_pluralize_formatters.rb
|
72
|
+
- lib/linguistics_latin_tense_block/version.rb
|
73
|
+
- linguistics_latin_tense_block.gemspec
|
74
|
+
- test/tense_block_test.rb
|
75
|
+
homepage: ''
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.2.2
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: Abstraction for extracting person / number combinations from an abstraction
|
99
|
+
(TenseBlock) holding a voice/mood/tense collection
|
100
|
+
test_files:
|
101
|
+
- test/tense_block_test.rb
|