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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4398fc12588191cd845586dd9bf1d35fc2c14427b9b12d9d4aef1be8ceb08ca
4
- data.tar.gz: 0a53c05242f3a014941367594ab0f8c11f849bc1895f16c73529d3ea4a6763da
3
+ metadata.gz: e68e66e3f4eff030e0a8d38e9856f5fc854aea5f7c5b1f03516537a07a74a569
4
+ data.tar.gz: 81c6b0f52be99ec12ec9c39895edcad1f89d893302cc5131a1b0c99d8eb49583
5
5
  SHA512:
6
- metadata.gz: df2365b999bd5bf2cde520ededf7ba05b51bf61a8d977bf1a79c090f2fa8fe49feb7557eb5168ef1fbd1e5a83352e1127bc0e95d1dc834b0b666fc110a8835c3
7
- data.tar.gz: a865fbc4a213ddceaed7735225b2e796e9c5d1b71ba98e6c8bc2153ee99ea4a4783bf06fa5c3c7e90b2d6e459ebe14acf811059f0b5aa5ef8290eff0a5124596
6
+ metadata.gz: 87e847ad4dd6d37ba84e92b5345a936fcb32809fe773f9b2af4044768f177253e3dae686c1ca90eeaed9dc690df7a3fdf1db5057e529964c353c9623ef4cdddf
7
+ data.tar.gz: 016f557843f2d116f2d0d68b4fbf719d7aa640cf00a07c322213653f0ae7d3b5439a69e168ac93f11a6c7b000b4643f03956a9fd9ef02babea778007c56fa1ed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- medieval_latina (1.0.22)
4
+ medieval_latina (1.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -23,9 +23,9 @@ Or install it yourself as:
23
23
 
24
24
  ```ruby
25
25
  ["caelum", "omnia", "pugno"].each { |word| puts MedievalLatina[word] }
26
- # "chay-loom"
27
- # "onm-nee-ah"
28
- # "poon-yoh"
26
+ # "chayloom"
27
+ # "ohm-nia"
28
+ # "poon-yoh"
29
29
  ```
30
30
 
31
31
  ## Development
@@ -1,3 +1,3 @@
1
1
  class MedievalLatina
2
- VERSION = "1.0.22"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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.22
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-08 00:00:00.000000000 Z
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.