medieval_latina 1.0.22 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/medieval_latina/version.rb +1 -1
- data/lib/medieval_latina.rb +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e68e66e3f4eff030e0a8d38e9856f5fc854aea5f7c5b1f03516537a07a74a569
|
4
|
+
data.tar.gz: 81c6b0f52be99ec12ec9c39895edcad1f89d893302cc5131a1b0c99d8eb49583
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87e847ad4dd6d37ba84e92b5345a936fcb32809fe773f9b2af4044768f177253e3dae686c1ca90eeaed9dc690df7a3fdf1db5057e529964c353c9623ef4cdddf
|
7
|
+
data.tar.gz: 016f557843f2d116f2d0d68b4fbf719d7aa640cf00a07c322213653f0ae7d3b5439a69e168ac93f11a6c7b000b4643f03956a9fd9ef02babea778007c56fa1ed
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
data/lib/medieval_latina.rb
CHANGED
@@ -1,13 +1,24 @@
|
|
1
1
|
require "medieval_latina/dictionary"
|
2
2
|
require "medieval_latina/version"
|
3
|
+
require "set"
|
3
4
|
|
4
5
|
class MedievalLatina
|
5
6
|
def self.[](text)
|
6
|
-
text.split(" ").map { |word|
|
7
|
+
clean(text).split(" ").map { |word|
|
7
8
|
DICTIONARY[word.downcase] || new(word).call
|
8
9
|
}.join(" ")
|
9
10
|
end
|
10
11
|
|
12
|
+
def self.clean(text)
|
13
|
+
text.chars.map do |character|
|
14
|
+
if PUNCTUATION.member?(character)
|
15
|
+
" "
|
16
|
+
else
|
17
|
+
character
|
18
|
+
end
|
19
|
+
end.join
|
20
|
+
end
|
21
|
+
|
11
22
|
def initialize(word)
|
12
23
|
@index = 0
|
13
24
|
@word = word.downcase
|
@@ -39,6 +50,7 @@ class MedievalLatina
|
|
39
50
|
x: ->(rest) { "ks" }
|
40
51
|
}
|
41
52
|
CONSONENT_TEAMS = {gn: "n-y", qu: "kw"}.freeze
|
53
|
+
PUNCTUATION = Set.new([".", ",", "!"]).freeze
|
42
54
|
SOFT_C = ["e", "i", "ae", "oe"].freeze
|
43
55
|
SOFT_G = SOFT_C
|
44
56
|
SOFT_T = ["i"].freeze
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: medieval_latina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jayson Virissimo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
There are good text-to-speech engines for English and classical Latin, but none for medieval Latin.
|