stefantaubert commited on
Commit
44d950f
1 Parent(s): fb03e61
Files changed (8) hide show
  1. .gitignore +111 -0
  2. Pipfile +24 -0
  3. Pipfile.lock +0 -0
  4. README.md +16 -6
  5. app.py +166 -0
  6. pylintrc +612 -0
  7. pyproject.toml +19 -0
  8. requirements.txt +1 -0
.gitignore ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ flagged/
2
+ .vscode/
3
+ .vscode
4
+ .ipynb_checkpoints
5
+
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ .mypy
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # pyenv
81
+ .python-version
82
+
83
+ # celery beat schedule file
84
+ celerybeat-schedule
85
+
86
+ # SageMath parsed files
87
+ *.sage.py
88
+
89
+ # Environments
90
+ .env
91
+ .venv
92
+ env/
93
+ venv/
94
+ ENV/
95
+ env.bak/
96
+ venv.bak/
97
+
98
+ # Spyder project settings
99
+ .spyderproject
100
+ .spyproject
101
+
102
+ # Rope project settings
103
+ .ropeproject
104
+
105
+ # mkdocs documentation
106
+ /site
107
+
108
+ # mypy
109
+ .mypy_cache/
110
+
111
+ .vscode
Pipfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [[source]]
2
+ url = "https://pypi.org/simple"
3
+ verify_ssl = true
4
+ name = "pypi"
5
+
6
+ [packages]
7
+ pinyin-to-ipa = ">=0.0.2"
8
+ gradio = {extras = ["oauth"], version = ">=4.26.0"}
9
+ uvicorn = ">=0.14.0"
10
+
11
+ [dev-packages]
12
+ autopep8 = "*"
13
+ pylint = "*"
14
+ pycodestyle = "*"
15
+ isort = "*"
16
+ rope = "*"
17
+ pytest = "*"
18
+ autoflake = "*"
19
+ twine = "*"
20
+ tox = "*"
21
+ build = "*"
22
+
23
+ [requires]
24
+ python_version = "3.11"
Pipfile.lock ADDED
The diff for this file is too large to render. See raw diff
 
README.md CHANGED
@@ -1,13 +1,23 @@
1
  ---
2
- title: Pinyin To Ipa
3
- emoji: 🚀
4
- colorFrom: pink
5
- colorTo: red
6
  sdk: gradio
7
- sdk_version: 4.27.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
 
 
 
 
 
 
 
11
  ---
12
 
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
+ title: pinyin-to-ipa
3
+ emoji: 💬
4
+ colorFrom: blue
5
+ colorTo: yellow
6
  sdk: gradio
7
+ sdk_version: 4.26.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ fullWidth: false
12
+ python_version: 3.11
13
+ tags:
14
+ - speech synthesis
15
+ - text-to-speech
16
+ - speech generation
17
+ - linguistics
18
+ startup_duration_timeout: 10m
19
  ---
20
 
21
+ # pinyin-to-ipa
22
+
23
+ Transcribing pinyin to IPA using `pinyin-to-ipa`.
app.py ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from pinyin_to_ipa import pinyin_to_ipa
3
+
4
+ # ri has 4 conversions
5
+
6
+
7
+ def run() -> None:
8
+ interface = build_interface()
9
+ interface.queue()
10
+ interface.launch(
11
+ share=False,
12
+ debug=True,
13
+ inbrowser=True,
14
+ quiet=False,
15
+ show_api=False,
16
+ )
17
+
18
+
19
+ def build_interface() -> gr.Blocks:
20
+ with gr.Blocks(
21
+ title="pinyin-to-ipa"
22
+ ) as web_app:
23
+ gr.Markdown(
24
+ """
25
+ # Pinyin to IPA conversion
26
+ """
27
+ )
28
+
29
+ with gr.Tab("Conversion"):
30
+ with gr.Row():
31
+ with gr.Column():
32
+ with gr.Group():
33
+ input_txt_box = gr.Textbox(
34
+ None,
35
+ label="Pinyin syllable",
36
+ placeholder="Enter the pinyin syllable you want to convert to IPA.",
37
+ lines=1,
38
+ max_lines=1,
39
+ )
40
+
41
+ convert_btn = gr.Button("Convert", variant="primary")
42
+
43
+ with gr.Column():
44
+ with gr.Group():
45
+ with gr.Row():
46
+ with gr.Column():
47
+ output_txt_box = gr.Textbox(
48
+ show_label=True,
49
+ label="IPA",
50
+ interactive=False,
51
+ show_copy_button=True,
52
+ placeholder="The IPA transcription of the input will be displayed here.",
53
+ lines=1,
54
+ max_lines=4, # ri
55
+ )
56
+
57
+ with gr.Row():
58
+ gr.Examples(
59
+ examples=[
60
+ ["pang1"],
61
+ ["pang2"],
62
+ ["pang3"],
63
+ ["pang4"],
64
+ ["pang5"],
65
+ ["pang"],
66
+ ["hàng"],
67
+ ["ang"], # no initial
68
+ ["hng"], # SYLLABIC_CONSONANT_MAPPINGS
69
+ ["ê"], # INTERJECTION_MAPPINGS
70
+ ["io"], # INTERJECTION_MAPPINGS
71
+ ["er"], # INTERJECTION_MAPPINGS
72
+ ["zhi"], # FINAL_MAPPING_AFTER_ZH_CH_SH_R
73
+ ["zi"], # FINAL_MAPPING_AFTER_Z_C_S
74
+ ],
75
+ fn=synt,
76
+ inputs=[
77
+ input_txt_box,
78
+ ],
79
+ outputs=[
80
+ output_txt_box,
81
+ ],
82
+ label="Examples",
83
+ cache_examples=False,
84
+ examples_per_page=20,
85
+ )
86
+
87
+ with gr.Tab("Info"):
88
+ with gr.Column():
89
+ gr.Markdown(
90
+ """
91
+
92
+ ### Phoneme Set
93
+
94
+ - Vowels: a ɛ e ə ɚ ɤ i o ɔ u ʊ y
95
+ - Diphthongs: ai̯ au̯ aɚ̯ ei̯ ou̯
96
+ - Consonants: f h j k kʰ l m n p pʰ ɹ̩¹ ɻ¹ ɻ̩¹ s t ts tsʰ tɕ tɕʰ tʰ w x ŋ ɕ ɥ ʂ ʈʂ ʈʂʰ z̩¹ ʐ¹ ʐ̩¹
97
+
98
+ Vowels and diphthongs contain one of these tones:
99
+
100
+ - first tone: ˥
101
+ - second tone: ˧˥
102
+ - third tone: ˧˩˧
103
+ - fourth tone: ˥˩
104
+ - fifth tone: (nothing)
105
+
106
+ ¹ These consonants contain also tones.
107
+
108
+ ### Citation
109
+
110
+ Taubert, S. (2024). pinyin-to-ipa (Version 0.0.2) [Computer software]. https://doi.org/10.5281/zenodo.10639971
111
+
112
+ ### References
113
+
114
+ - [https://en.wikipedia.org/wiki/Help:IPA/Mandarin](https://en.wikipedia.org/wiki/Help:IPA/Mandarin)
115
+ - [https://en.wikipedia.org/wiki/Standard_Chinese_phonology](https://en.wikipedia.org/wiki/Standard_Chinese_phonology)
116
+ - [https://en.wikipedia.org/wiki/Pinyin](https://en.wikipedia.org/wiki/Pinyin)
117
+ - [https://de.wikipedia.org/wiki/Pinyin](https://de.wikipedia.org/wiki/Pinyin)
118
+ - Duanmu, San. 2007. The Phonology of Standard Chinese. 2nd ed. Oxford ; New York: Oxford University Press.
119
+ - Lin, Yen-Hwei. 2007. The Sounds of Chinese. Cambridge, UK ; New York: Cambridge University Press.
120
+
121
+ ### Acknowledgments
122
+
123
+ [pypinyin](https://github.com/mozillazg/python-pinyin) \\
124
+ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – [CRC 1410](https://gepris.dfg.de/gepris/projekt/416228727?context=projekt&task=showDetail&id=416228727)
125
+
126
+ ### App information
127
+
128
+ - Version: 0.0.2
129
+ - License: [MIT](https://github.com/stefantaubert/pinyin-to-ipa?tab=MIT-1-ov-file#readme)
130
+ - GitHub: [stefantaubert/pinyin-to-ipa](https://github.com/stefantaubert/pinyin-to-ipa)
131
+ """
132
+ )
133
+
134
+ # pylint: disable=E1101:no-member
135
+ convert_btn.click(
136
+ fn=synt,
137
+ inputs=[
138
+ input_txt_box,
139
+ ],
140
+ outputs=[
141
+ output_txt_box,
142
+ ],
143
+ queue=True,
144
+ show_progress=False,
145
+ )
146
+
147
+ return web_app
148
+
149
+
150
+ def synt(pinyin: str) -> str:
151
+ try:
152
+ output = pinyin_to_ipa(pinyin)
153
+ except ValueError as error:
154
+ result = "No valid pinyin detected! Please make sure to enter only one syllable."
155
+ return result
156
+
157
+ result = "\n".join(
158
+ [
159
+ "".join(x) for x in output
160
+ ]
161
+ )
162
+ return result
163
+
164
+
165
+ if __name__ == "__main__":
166
+ run()
pylintrc ADDED
@@ -0,0 +1,612 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [MAIN]
2
+
3
+ # Analyse import fallback blocks. This can be used to support both Python 2 and
4
+ # 3 compatible code, which means that the block might have code that exists
5
+ # only in one or another interpreter, leading to false positives when analysed.
6
+ analyse-fallback-blocks=no
7
+
8
+ # Load and enable all available extensions. Use --list-extensions to see a list
9
+ # all available extensions.
10
+ #enable-all-extensions=
11
+
12
+ # In error mode, checkers without error messages are disabled and for others,
13
+ # only the ERROR messages are displayed, and no reports are done by default.
14
+ #errors-only=
15
+
16
+ # Always return a 0 (non-error) status code, even if lint errors are found.
17
+ # This is primarily useful in continuous integration scripts.
18
+ #exit-zero=
19
+
20
+ # A comma-separated list of package or module names from where C extensions may
21
+ # be loaded. Extensions are loading into the active Python interpreter and may
22
+ # run arbitrary code.
23
+ extension-pkg-allow-list=
24
+
25
+ # A comma-separated list of package or module names from where C extensions may
26
+ # be loaded. Extensions are loading into the active Python interpreter and may
27
+ # run arbitrary code. (This is an alternative name to extension-pkg-allow-list
28
+ # for backward compatibility.)
29
+ extension-pkg-whitelist=
30
+
31
+ # Return non-zero exit code if any of these messages/categories are detected,
32
+ # even if score is above --fail-under value. Syntax same as enable. Messages
33
+ # specified are enabled, while categories only check already-enabled messages.
34
+ fail-on=
35
+
36
+ # Specify a score threshold to be exceeded before program exits with error.
37
+ fail-under=10.0
38
+
39
+ # Interpret the stdin as a python script, whose filename needs to be passed as
40
+ # the module_or_package argument.
41
+ #from-stdin=
42
+
43
+ # Files or directories to be skipped. They should be base names, not paths.
44
+ ignore=CVS
45
+
46
+ # Add files or directories matching the regex patterns to the ignore-list. The
47
+ # regex matches against paths and can be in Posix or Windows format.
48
+ ignore-paths=
49
+
50
+ # Files or directories matching the regex patterns are skipped. The regex
51
+ # matches against base names, not paths. The default value ignores Emacs file
52
+ # locks
53
+ ignore-patterns=
54
+
55
+ # List of module names for which member attributes should not be checked
56
+ # (useful for modules/projects where namespaces are manipulated during runtime
57
+ # and thus existing member attributes cannot be deduced by static analysis). It
58
+ # supports qualified module names, as well as Unix pattern matching.
59
+ ignored-modules=
60
+
61
+ # Python code to execute, usually for sys.path manipulation such as
62
+ # pygtk.require().
63
+ #init-hook=
64
+
65
+ # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
66
+ # number of processors available to use.
67
+ jobs=1
68
+
69
+ # Control the amount of potential inferred values when inferring a single
70
+ # object. This can help the performance when dealing with large functions or
71
+ # complex, nested conditions.
72
+ limit-inference-results=100
73
+
74
+ # List of plugins (as comma separated values of python module names) to load,
75
+ # usually to register additional checkers.
76
+ load-plugins=
77
+
78
+ # Pickle collected data for later comparisons.
79
+ persistent=yes
80
+
81
+ # Minimum Python version to use for version dependent checks. Will default to
82
+ # the version used to run pylint.
83
+ py-version=3.9
84
+
85
+ # Discover python modules and packages in the file system subtree.
86
+ recursive=no
87
+
88
+ # When enabled, pylint would attempt to guess common misconfiguration and emit
89
+ # user-friendly hints instead of false-positive error messages.
90
+ suggestion-mode=yes
91
+
92
+ # Allow loading of arbitrary C extensions. Extensions are imported into the
93
+ # active Python interpreter and may run arbitrary code.
94
+ unsafe-load-any-extension=no
95
+
96
+ # In verbose mode, extra non-checker-related info will be displayed.
97
+ #verbose=
98
+
99
+
100
+ [REPORTS]
101
+
102
+ # Python expression which should return a score less than or equal to 10. You
103
+ # have access to the variables 'fatal', 'error', 'warning', 'refactor',
104
+ # 'convention', and 'info' which contain the number of messages in each
105
+ # category, as well as 'statement' which is the total number of statements
106
+ # analyzed. This score is used by the global evaluation report (RP0004).
107
+ evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
108
+
109
+ # Template used to display messages. This is a python new-style format string
110
+ # used to format the message information. See doc for all details.
111
+ msg-template=
112
+
113
+ # Set the output format. Available formats are text, parseable, colorized, json
114
+ # and msvs (visual studio). You can also give a reporter class, e.g.
115
+ # mypackage.mymodule.MyReporterClass.
116
+ #output-format=
117
+
118
+ # Tells whether to display a full report or only the messages.
119
+ reports=no
120
+
121
+ # Activate the evaluation score.
122
+ score=yes
123
+
124
+
125
+ [MESSAGES CONTROL]
126
+
127
+ # Only show warnings with the listed confidence levels. Leave empty to show
128
+ # all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
129
+ # UNDEFINED.
130
+ confidence=HIGH,
131
+ CONTROL_FLOW,
132
+ INFERENCE,
133
+ INFERENCE_FAILURE,
134
+ UNDEFINED
135
+
136
+ # Disable the message, report, category or checker with the given id(s). You
137
+ # can either give multiple identifiers separated by comma (,) or put this
138
+ # option multiple times (only on the command line, not in the configuration
139
+ # file where it should appear only once). You can also use "--disable=all" to
140
+ # disable everything first and then re-enable specific checks. For example, if
141
+ # you want to run only the similarities checker, you can use "--disable=all
142
+ # --enable=similarities". If you want to run only the classes checker, but have
143
+ # no Warning level messages displayed, use "--disable=all --enable=classes
144
+ # --disable=W".
145
+ disable=raw-checker-failed,
146
+ bad-inline-option,
147
+ locally-disabled,
148
+ file-ignored,
149
+ suppressed-message,
150
+ useless-suppression,
151
+ deprecated-pragma,
152
+ use-symbolic-message-instead,
153
+ missing-module-docstring,
154
+ missing-class-docstring,
155
+ missing-function-docstring,
156
+ logging-fstring-interpolation
157
+
158
+ # Enable the message, report, category or checker with the given id(s). You can
159
+ # either give multiple identifier separated by comma (,) or put this option
160
+ # multiple time (only on the command line, not in the configuration file where
161
+ # it should appear only once). See also the "--disable" option for examples.
162
+ enable=c-extension-no-member
163
+
164
+
165
+ [EXCEPTIONS]
166
+
167
+ # Exceptions that will emit a warning when caught.
168
+ overgeneral-exceptions=BaseException,
169
+ Exception
170
+
171
+
172
+ [STRING]
173
+
174
+ # This flag controls whether inconsistent-quotes generates a warning when the
175
+ # character used as a quote delimiter is used inconsistently within a module.
176
+ check-quote-consistency=no
177
+
178
+ # This flag controls whether the implicit-str-concat should generate a warning
179
+ # on implicit string concatenation in sequences defined over several lines.
180
+ check-str-concat-over-line-jumps=no
181
+
182
+
183
+ [SPELLING]
184
+
185
+ # Limits count of emitted suggestions for spelling mistakes.
186
+ max-spelling-suggestions=4
187
+
188
+ # Spelling dictionary name. Available dictionaries: none. To make it work,
189
+ # install the 'python-enchant' package.
190
+ spelling-dict=
191
+
192
+ # List of comma separated words that should be considered directives if they
193
+ # appear at the beginning of a comment and should not be checked.
194
+ spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
195
+
196
+ # List of comma separated words that should not be checked.
197
+ spelling-ignore-words=
198
+
199
+ # A path to a file that contains the private dictionary; one word per line.
200
+ spelling-private-dict-file=
201
+
202
+ # Tells whether to store unknown words to the private dictionary (see the
203
+ # --spelling-private-dict-file option) instead of raising a message.
204
+ spelling-store-unknown-words=no
205
+
206
+
207
+ [IMPORTS]
208
+
209
+ # List of modules that can be imported at any level, not just the top level
210
+ # one.
211
+ allow-any-import-level=
212
+
213
+ # Allow wildcard imports from modules that define __all__.
214
+ allow-wildcard-with-all=no
215
+
216
+ # Deprecated modules which should not be used, separated by a comma.
217
+ deprecated-modules=optparse,tkinter.tix
218
+
219
+ # Output a graph (.gv or any supported image format) of external dependencies
220
+ # to the given file (report RP0402 must not be disabled).
221
+ ext-import-graph=
222
+
223
+ # Output a graph (.gv or any supported image format) of all (i.e. internal and
224
+ # external) dependencies to the given file (report RP0402 must not be
225
+ # disabled).
226
+ import-graph=
227
+
228
+ # Output a graph (.gv or any supported image format) of internal dependencies
229
+ # to the given file (report RP0402 must not be disabled).
230
+ int-import-graph=
231
+
232
+ # Force import order to recognize a module as part of the standard
233
+ # compatibility libraries.
234
+ known-standard-library=
235
+
236
+ # Force import order to recognize a module as part of a third party library.
237
+ known-third-party=enchant
238
+
239
+ # Couples of modules and preferred modules, separated by a comma.
240
+ preferred-modules=
241
+
242
+
243
+ [REFACTORING]
244
+
245
+ # Maximum number of nested blocks for function / method body
246
+ max-nested-blocks=5
247
+
248
+ # Complete name of functions that never returns. When checking for
249
+ # inconsistent-return-statements if a never returning function is called then
250
+ # it will be considered as an explicit return statement and no message will be
251
+ # printed.
252
+ never-returning-functions=sys.exit
253
+
254
+
255
+ [MISCELLANEOUS]
256
+
257
+ # List of note tags to take in consideration, separated by a comma.
258
+ notes=FIXME,
259
+ XXX,
260
+ TODO
261
+
262
+ # Regular expression of note tags to take in consideration.
263
+ notes-rgx=
264
+
265
+
266
+ [DESIGN]
267
+
268
+ # List of regular expressions of class ancestor names to ignore when counting
269
+ # public methods (see R0903)
270
+ exclude-too-few-public-methods=
271
+
272
+ # List of qualified class names to ignore when counting class parents (see
273
+ # R0901)
274
+ ignored-parents=
275
+
276
+ # Maximum number of arguments for function / method.
277
+ max-args=100
278
+
279
+ # Maximum number of attributes for a class (see R0902).
280
+ max-attributes=7
281
+
282
+ # Maximum number of boolean expressions in an if statement (see R0916).
283
+ max-bool-expr=5
284
+
285
+ # Maximum number of branch for function / method body.
286
+ max-branches=12
287
+
288
+ # Maximum number of locals for function / method body.
289
+ max-locals=15
290
+
291
+ # Maximum number of parents for a class (see R0901).
292
+ max-parents=7
293
+
294
+ # Maximum number of public methods for a class (see R0904).
295
+ max-public-methods=100
296
+
297
+ # Maximum number of return / yield for function / method body.
298
+ max-returns=6
299
+
300
+ # Maximum number of statements in function / method body.
301
+ max-statements=50
302
+
303
+ # Minimum number of public methods for a class (see R0903).
304
+ min-public-methods=0
305
+
306
+
307
+ [VARIABLES]
308
+
309
+ # List of additional names supposed to be defined in builtins. Remember that
310
+ # you should avoid defining new builtins when possible.
311
+ additional-builtins=
312
+
313
+ # Tells whether unused global variables should be treated as a violation.
314
+ allow-global-unused-variables=yes
315
+
316
+ # List of names allowed to shadow builtins
317
+ allowed-redefined-builtins=
318
+
319
+ # List of strings which can identify a callback function by name. A callback
320
+ # name must start or end with one of those strings.
321
+ callbacks=cb_,
322
+ _cb
323
+
324
+ # A regular expression matching the name of dummy variables (i.e. expected to
325
+ # not be used).
326
+ dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
327
+
328
+ # Argument names that match this expression will be ignored. Default to name
329
+ # with leading underscore.
330
+ ignored-argument-names=_.*|^ignored_|^unused_
331
+
332
+ # Tells whether we should check for unused import in __init__ files.
333
+ init-import=no
334
+
335
+ # List of qualified module names which can have objects that can redefine
336
+ # builtins.
337
+ redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
338
+
339
+
340
+ [BASIC]
341
+
342
+ # Naming style matching correct argument names.
343
+ argument-naming-style=snake_case
344
+
345
+ # Regular expression matching correct argument names. Overrides argument-
346
+ # naming-style. If left empty, argument names will be checked with the set
347
+ # naming style.
348
+ #argument-rgx=
349
+
350
+ # Naming style matching correct attribute names.
351
+ attr-naming-style=snake_case
352
+
353
+ # Regular expression matching correct attribute names. Overrides attr-naming-
354
+ # style. If left empty, attribute names will be checked with the set naming
355
+ # style.
356
+ #attr-rgx=
357
+
358
+ # Bad variable names which should always be refused, separated by a comma.
359
+ bad-names=foo,
360
+ bar,
361
+ baz,
362
+ toto,
363
+ tutu,
364
+ tata
365
+
366
+ # Bad variable names regexes, separated by a comma. If names match any regex,
367
+ # they will always be refused
368
+ bad-names-rgxs=
369
+
370
+ # Naming style matching correct class attribute names.
371
+ class-attribute-naming-style=any
372
+
373
+ # Regular expression matching correct class attribute names. Overrides class-
374
+ # attribute-naming-style. If left empty, class attribute names will be checked
375
+ # with the set naming style.
376
+ #class-attribute-rgx=
377
+
378
+ # Naming style matching correct class constant names.
379
+ class-const-naming-style=UPPER_CASE
380
+
381
+ # Regular expression matching correct class constant names. Overrides class-
382
+ # const-naming-style. If left empty, class constant names will be checked with
383
+ # the set naming style.
384
+ #class-const-rgx=
385
+
386
+ # Naming style matching correct class names.
387
+ class-naming-style=PascalCase
388
+
389
+ # Regular expression matching correct class names. Overrides class-naming-
390
+ # style. If left empty, class names will be checked with the set naming style.
391
+ #class-rgx=
392
+
393
+ # Naming style matching correct constant names.
394
+ const-naming-style=UPPER_CASE
395
+
396
+ # Regular expression matching correct constant names. Overrides const-naming-
397
+ # style. If left empty, constant names will be checked with the set naming
398
+ # style.
399
+ #const-rgx=
400
+
401
+ # Minimum line length for functions/classes that require docstrings, shorter
402
+ # ones are exempt.
403
+ docstring-min-length=-1
404
+
405
+ # Naming style matching correct function names.
406
+ function-naming-style=snake_case
407
+
408
+ # Regular expression matching correct function names. Overrides function-
409
+ # naming-style. If left empty, function names will be checked with the set
410
+ # naming style.
411
+ #function-rgx=
412
+
413
+ # Good variable names which should always be accepted, separated by a comma.
414
+ good-names=i,
415
+ j,
416
+ k,
417
+ ex,
418
+ Run,
419
+ _
420
+
421
+ # Good variable names regexes, separated by a comma. If names match any regex,
422
+ # they will always be accepted
423
+ good-names-rgxs=
424
+
425
+ # Include a hint for the correct naming format with invalid-name.
426
+ include-naming-hint=no
427
+
428
+ # Naming style matching correct inline iteration names.
429
+ inlinevar-naming-style=any
430
+
431
+ # Regular expression matching correct inline iteration names. Overrides
432
+ # inlinevar-naming-style. If left empty, inline iteration names will be checked
433
+ # with the set naming style.
434
+ #inlinevar-rgx=
435
+
436
+ # Naming style matching correct method names.
437
+ method-naming-style=snake_case
438
+
439
+ # Regular expression matching correct method names. Overrides method-naming-
440
+ # style. If left empty, method names will be checked with the set naming style.
441
+ #method-rgx=
442
+
443
+ # Naming style matching correct module names.
444
+ module-naming-style=snake_case
445
+
446
+ # Regular expression matching correct module names. Overrides module-naming-
447
+ # style. If left empty, module names will be checked with the set naming style.
448
+ #module-rgx=
449
+
450
+ # Colon-delimited sets of names that determine each other's naming style when
451
+ # the name regexes allow several styles.
452
+ name-group=
453
+
454
+ # Regular expression which should only match function or class names that do
455
+ # not require a docstring.
456
+ no-docstring-rgx=^_
457
+
458
+ # List of decorators that produce properties, such as abc.abstractproperty. Add
459
+ # to this list to register other decorators that produce valid properties.
460
+ # These decorators are taken in consideration only for invalid-name.
461
+ property-classes=abc.abstractproperty
462
+
463
+ # Regular expression matching correct type variable names. If left empty, type
464
+ # variable names will be checked with the set naming style.
465
+ #typevar-rgx=
466
+
467
+ # Naming style matching correct variable names.
468
+ variable-naming-style=snake_case
469
+
470
+ # Regular expression matching correct variable names. Overrides variable-
471
+ # naming-style. If left empty, variable names will be checked with the set
472
+ # naming style.
473
+ #variable-rgx=
474
+
475
+
476
+ [CLASSES]
477
+
478
+ # Warn about protected attribute access inside special methods
479
+ check-protected-access-in-special-methods=no
480
+
481
+ # List of method names used to declare (i.e. assign) instance attributes.
482
+ defining-attr-methods=__init__,
483
+ __new__,
484
+ setUp,
485
+ __post_init__
486
+
487
+ # List of member names, which should be excluded from the protected access
488
+ # warning.
489
+ exclude-protected=_asdict,
490
+ _fields,
491
+ _replace,
492
+ _source,
493
+ _make
494
+
495
+ # List of valid names for the first argument in a class method.
496
+ valid-classmethod-first-arg=cls
497
+
498
+ # List of valid names for the first argument in a metaclass class method.
499
+ valid-metaclass-classmethod-first-arg=cls
500
+
501
+
502
+ [FORMAT]
503
+
504
+ # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
505
+ expected-line-ending-format=
506
+
507
+ # Regexp for a line that is allowed to be longer than the limit.
508
+ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
509
+
510
+ # Number of spaces of indent required inside a hanging or continued line.
511
+ indent-after-paren=2
512
+
513
+ # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
514
+ # tab).
515
+ indent-string=' '
516
+
517
+ # Maximum number of characters on a single line.
518
+ max-line-length=100
519
+
520
+ # Maximum number of lines in a module.
521
+ max-module-lines=1000
522
+
523
+ # Allow the body of a class to be on the same line as the declaration if body
524
+ # contains single statement.
525
+ single-line-class-stmt=no
526
+
527
+ # Allow the body of an if to be on the same line as the test if there is no
528
+ # else.
529
+ single-line-if-stmt=no
530
+
531
+
532
+ [LOGGING]
533
+
534
+ # The type of string formatting that logging methods do. `old` means using %
535
+ # formatting, `new` is for `{}` formatting.
536
+ logging-format-style=old
537
+
538
+ # Logging modules to check that the string format arguments are in logging
539
+ # function parameter format.
540
+ logging-modules=logging
541
+
542
+
543
+ [TYPECHECK]
544
+
545
+ # List of decorators that produce context managers, such as
546
+ # contextlib.contextmanager. Add to this list to register other decorators that
547
+ # produce valid context managers.
548
+ contextmanager-decorators=contextlib.contextmanager
549
+
550
+ # List of members which are set dynamically and missed by pylint inference
551
+ # system, and so shouldn't trigger E1101 when accessed. Python regular
552
+ # expressions are accepted.
553
+ generated-members=numpy.* ,torch.*
554
+
555
+ # Tells whether to warn about missing members when the owner of the attribute
556
+ # is inferred to be None.
557
+ ignore-none=yes
558
+
559
+ # This flag controls whether pylint should warn about no-member and similar
560
+ # checks whenever an opaque object is returned when inferring. The inference
561
+ # can return multiple potential results while evaluating a Python object, but
562
+ # some branches might not be evaluated, which results in partial inference. In
563
+ # that case, it might be useful to still emit no-member and other checks for
564
+ # the rest of the inferred objects.
565
+ ignore-on-opaque-inference=yes
566
+
567
+ # List of symbolic message names to ignore for Mixin members.
568
+ ignored-checks-for-mixins=no-member,
569
+ not-async-context-manager,
570
+ not-context-manager,
571
+ attribute-defined-outside-init
572
+
573
+ # List of class names for which member attributes should not be checked (useful
574
+ # for classes with dynamically set attributes). This supports the use of
575
+ # qualified names.
576
+ ignored-classes=optparse.Values,thread._local,_thread._local
577
+
578
+ # Show a hint with possible names when a member name was not found. The aspect
579
+ # of finding the hint is based on edit distance.
580
+ missing-member-hint=yes
581
+
582
+ # The minimum edit distance a name should have in order to be considered a
583
+ # similar match for a missing member name.
584
+ missing-member-hint-distance=1
585
+
586
+ # The total number of similar names that should be taken in consideration when
587
+ # showing a hint for a missing member.
588
+ missing-member-max-choices=1
589
+
590
+ # Regex pattern to define which classes are considered mixins.
591
+ mixin-class-rgx=.*[Mm]ixin
592
+
593
+ # List of decorators that change the signature of a decorated function.
594
+ signature-mutators=
595
+
596
+
597
+ [SIMILARITIES]
598
+
599
+ # Comments are removed from the similarity computation
600
+ ignore-comments=yes
601
+
602
+ # Docstrings are removed from the similarity computation
603
+ ignore-docstrings=yes
604
+
605
+ # Imports are removed from the similarity computation
606
+ ignore-imports=no
607
+
608
+ # Signatures are removed from the similarity computation
609
+ ignore-signatures=yes
610
+
611
+ # Minimum lines number of a similarity.
612
+ min-similarity-lines=4
pyproject.toml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [tool.autopep8]
2
+ indent-size = 2
3
+ ignore = ["E121"]
4
+ max_line_length = 100
5
+
6
+ [tool.isort]
7
+ line_length = 100
8
+ indent = 2
9
+ known_first_party = ["en_tts", "en_tts_cli", "en_tts_app", "en_tts_gr"]
10
+ known_third_party = [
11
+ "scipy",
12
+ "numpy",
13
+ "tqdm",
14
+ "TextGrid",
15
+ "pandas",
16
+ "ordered_set",
17
+ "matplotlib",
18
+ "pronunciation_dictionary",
19
+ ]
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ pinyin-to-ipa>=0.0.2