Skip to content

Commit

Permalink
[natural_translit] Add new Phon class. Add vowels and pulmonic conson…
Browse files Browse the repository at this point in the history
…ants with dedicated IPA symbols to the multilingual Phon inventory. The default phonological features are derived from the location of the phoneme on the IPA table.

PiperOrigin-RevId: 718116084
  • Loading branch information
isingoo authored and copybara-github committed Jan 22, 2025
1 parent 016b469 commit a71185d
Show file tree
Hide file tree
Showing 7 changed files with 3,392 additions and 0 deletions.
24 changes: 24 additions & 0 deletions nisaba/scripts/natural_translit/phonology/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ py_library(
],
)

py_library(
name = "phonological_symbol",
srcs = ["phonological_symbol.py"],
deps = [
":descriptive_features",
"//nisaba/scripts/natural_translit/utils:expression",
"//nisaba/scripts/natural_translit/utils:feature",
"//nisaba/scripts/natural_translit/utils:inventory",
"//nisaba/scripts/natural_translit/utils:symbol",
"//nisaba/scripts/natural_translit/utils:type_op",
],
)

py_test(
name = "phonological_symbol_test",
srcs = ["phonological_symbol_test.py"],
main = "phonological_symbol_test.py",
deps = [
":phonological_symbol",
"//nisaba/scripts/natural_translit/utils:test_op",
"@io_abseil_py//absl/testing:absltest",
],
)

py_library(
name = "romanizer",
srcs = ["romanizer.py"],
Expand Down
38 changes: 38 additions & 0 deletions nisaba/scripts/natural_translit/phonology/inventories/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2024 Nisaba Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Phonological object inventories."""

package(
default_visibility = ["//visibility:public"],
)

py_library(
name = "x_mul",
srcs = ["x_mul.py"],
deps = [
"//nisaba/scripts/natural_translit/phonology:phonological_symbol",
],
)

py_test(
name = "x_mul_test",
srcs = ["x_mul_test.py"],
main = "x_mul_test.py",
deps = [
":x_mul",
"//nisaba/scripts/natural_translit/utils:test_op",
"@io_abseil_py//absl/testing:absltest",
],
)
Loading

0 comments on commit a71185d

Please sign in to comment.