signwriting 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- signwriting-0.1.1/LICENSE +21 -0
- signwriting-0.1.1/PKG-INFO +189 -0
- signwriting-0.1.1/README.md +167 -0
- signwriting-0.1.1/pyproject.toml +66 -0
- signwriting-0.1.1/setup.cfg +4 -0
- signwriting-0.1.1/signwriting/__init__.py +0 -0
- signwriting-0.1.1/signwriting/fingerspelling/__init__.py +0 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/da-dk-dsl-dts.txt +43 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/de-ch-sgg-dsgs.txt +42 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/de-de-gsg-dgs.txt +48 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/en-gb-bfi-bsl.txt +39 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/en-ie-isg-isl.txt +40 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/en-us-ase-asl.txt +41 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/es-es-ssp-lse.txt +44 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/es-hn-hds-lesho.txt +44 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/es-mx-mfs-lsm.txt +42 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/es-ni-ncs-isn.txt +44 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/fr-be-sfb-lsfb.txt +45 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/fr-fr-fsl-lsf.txt +45 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/he-il-isr-isl.txt +24 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/it-it-ise-lis.txt +47 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/ja-jp-jsl-jsl.txt +80 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/ko-kr-ko-ksl.txt +50 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/nl-be-vgt-vgt.txt +45 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/no-no-nsl-nsl.txt +44 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/pt-br-bzs-libras.txt +41 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/pt-pt-psr-lsp.txt +37 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/sv-se-swl-ssl.txt +43 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/th-th-tsq-thsl.txt +90 -0
- signwriting-0.1.1/signwriting/fingerspelling/data/zh-cn-csl-csl.txt +95 -0
- signwriting-0.1.1/signwriting/fingerspelling/fingerspelling.py +62 -0
- signwriting-0.1.1/signwriting/fingerspelling/server.py +21 -0
- signwriting-0.1.1/signwriting/fingerspelling/test_fingerspelling.py +19 -0
- signwriting-0.1.1/signwriting/fingerspelling/visualize_fingerspelling.py +42 -0
- signwriting-0.1.1/signwriting/formats/__init__.py +0 -0
- signwriting-0.1.1/signwriting/formats/fsw_to_sign.py +23 -0
- signwriting-0.1.1/signwriting/formats/fsw_to_swu.py +48 -0
- signwriting-0.1.1/signwriting/formats/sign_to_fsw.py +12 -0
- signwriting-0.1.1/signwriting/formats/swu.py +35 -0
- signwriting-0.1.1/signwriting/formats/swu_to_fsw.py +42 -0
- signwriting-0.1.1/signwriting/formats/test_fsw_to_sign.py +21 -0
- signwriting-0.1.1/signwriting/formats/test_swu.py +33 -0
- signwriting-0.1.1/signwriting/formats/test_swu_to_fsw.py +19 -0
- signwriting-0.1.1/signwriting/hamnosys/parallel.json +28346 -0
- signwriting-0.1.1/signwriting/mouthing/__init__.py +0 -0
- signwriting-0.1.1/signwriting/mouthing/mouthing.json +354 -0
- signwriting-0.1.1/signwriting/mouthing/mouthing.py +105 -0
- signwriting-0.1.1/signwriting/mouthing/server.py +17 -0
- signwriting-0.1.1/signwriting/mouthing/visualize_mouthing.py +47 -0
- signwriting-0.1.1/signwriting/server.py +30 -0
- signwriting-0.1.1/signwriting/tokenizer/__init__.py +7 -0
- signwriting-0.1.1/signwriting/tokenizer/base_tokenizer.py +72 -0
- signwriting-0.1.1/signwriting/tokenizer/signwriting_normalizer.py +14 -0
- signwriting-0.1.1/signwriting/tokenizer/signwriting_tokenizer.py +74 -0
- signwriting-0.1.1/signwriting/tokenizer/test_signwriting_normalizer.py +35 -0
- signwriting-0.1.1/signwriting/tokenizer/test_signwriting_tokenizer.py +89 -0
- signwriting-0.1.1/signwriting/types.py +11 -0
- signwriting-0.1.1/signwriting/utils/__init__.py +0 -0
- signwriting-0.1.1/signwriting/utils/join_signs.py +88 -0
- signwriting-0.1.1/signwriting/utils/test_join_signs.py +34 -0
- signwriting-0.1.1/signwriting/visualizer/SuttonSignWritingFill.ttf +0 -0
- signwriting-0.1.1/signwriting/visualizer/SuttonSignWritingLine.ttf +0 -0
- signwriting-0.1.1/signwriting/visualizer/SuttonSignWritingOneD.ttf +0 -0
- signwriting-0.1.1/signwriting/visualizer/__init__.py +0 -0
- signwriting-0.1.1/signwriting/visualizer/server.py +45 -0
- signwriting-0.1.1/signwriting/visualizer/test_visualize.py +94 -0
- signwriting-0.1.1/signwriting/visualizer/visualize.py +105 -0
- signwriting-0.1.1/signwriting.egg-info/PKG-INFO +189 -0
- signwriting-0.1.1/signwriting.egg-info/SOURCES.txt +70 -0
- signwriting-0.1.1/signwriting.egg-info/dependency_links.txt +1 -0
- signwriting-0.1.1/signwriting.egg-info/requires.txt +16 -0
- signwriting-0.1.1/signwriting.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Sign Language Processing
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: signwriting
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Python utilities for SignWriting.
|
|
5
|
+
Author-email: Amit Moryossef <amitmoryossef@gmail.com>
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Dist: Pillow
|
|
9
|
+
Provides-Extra: dev
|
|
10
|
+
Requires-Dist: pytest; extra == "dev"
|
|
11
|
+
Requires-Dist: pylint; extra == "dev"
|
|
12
|
+
Requires-Dist: numpy; extra == "dev"
|
|
13
|
+
Provides-Extra: mouthing
|
|
14
|
+
Requires-Dist: epitran; extra == "mouthing"
|
|
15
|
+
Requires-Dist: g2pk; extra == "mouthing"
|
|
16
|
+
Provides-Extra: server
|
|
17
|
+
Requires-Dist: Flask; extra == "server"
|
|
18
|
+
Requires-Dist: Flask-RESTful; extra == "server"
|
|
19
|
+
Requires-Dist: Flask-Cors; extra == "server"
|
|
20
|
+
Requires-Dist: gunicorn; extra == "server"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# SignWriting
|
|
24
|
+
|
|
25
|
+
Python utilities for SignWriting.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install git+https://github.com/sign-language-processing/signwriting
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or with Docker:
|
|
34
|
+
```shell
|
|
35
|
+
docker build --platform linux/amd64 --tag signwriting:python .
|
|
36
|
+
docker run --platform linux/amd64 --rm -p 9090:8080 -e PORT=8080 signwriting:python
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Utilities
|
|
40
|
+
|
|
41
|
+
### `signwriting.formats`
|
|
42
|
+
|
|
43
|
+
This module provides utilities for converting between different formats of SignWriting.
|
|
44
|
+
We include a few examples:
|
|
45
|
+
|
|
46
|
+
1. To parse an FSW string into a [`Sign`](signwriting/types.py) object, representing the sign as a dictionary:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from signwriting.formats.fsw_to_sign import fsw_to_sign
|
|
50
|
+
|
|
51
|
+
fsw_to_sign("M123x456S1f720487x492")
|
|
52
|
+
# {'box': {'symbol': 'M', 'position': (123, 456)}, 'symbols': [{'symbol': 'S1f720', 'position': (487, 492)}]}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
2. To convert a SignWriting string in SWU format to FSW format:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from signwriting.formats.swu_to_fsw import swu2fsw
|
|
59
|
+
|
|
60
|
+
swu2fsw('𝠃𝤟𝤩𝣵𝤐𝤇𝣤𝤐𝤆𝣮𝣭')
|
|
61
|
+
# M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `signwriting.tokenizer`
|
|
65
|
+
|
|
66
|
+
This module provides utilities for tokenizing SignWriting strings for use in NLP tasks[^1].
|
|
67
|
+
We include a few usage non-exhaustive examples:
|
|
68
|
+
|
|
69
|
+
1. To tokenize a SignWriting string into a list of tokens:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from signwriting.tokenizer import SignWritingTokenizer
|
|
73
|
+
|
|
74
|
+
tokenizer = SignWritingTokenizer()
|
|
75
|
+
|
|
76
|
+
fsw = 'M123x456S1f720487x492S1f720487x492'
|
|
77
|
+
tokens = list(tokenizer.text_to_tokens(fsw, box_position=True))
|
|
78
|
+
# ['M', 'p123', 'p456', 'S1f7', 'c2', 'r0', 'p487', 'p492', 'S1f7', 'c2', 'r0', 'p487', 'p492'])
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
2. To convert a list of tokens back to a SignWriting string:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
tokenizer.tokens_to_text(tokens)
|
|
85
|
+
# M123x456S1f720487x492S1f720487x492
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
3. For machine learning purposes, we can convert the tokens to a list of integers:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
tokenizer.tokenize(fsw, bos=False, eos=False)
|
|
92
|
+
# [6, 932, 932, 255, 678, 660, 919, 924, 255, 678, 660, 919, 924]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
4. Or to remove 'A' information, and separate signs by spaces, we can use:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from signwriting.tokenizer import normalize_signwriting
|
|
99
|
+
|
|
100
|
+
normalize_signwriting(fsw)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### `signwriting.visualizer`
|
|
104
|
+
|
|
105
|
+
This module is used to visualize SignWriting strings as images.
|
|
106
|
+
Unlike [sutton-signwriting/font-db](https://github.com/sutton-signwriting/font-db/) which it is based on, this module
|
|
107
|
+
does not support custom styling. Benchmarks show that this module is ~5000x faster than the original implementation.
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from signwriting.visualizer.visualize import signwriting_to_image
|
|
111
|
+
|
|
112
|
+
fsw = "AS10011S10019S2e704S2e748M525x535S2e748483x510S10011501x466S20544510x500S10019476x475"
|
|
113
|
+
signwriting_to_image(fsw)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+

|
|
117
|
+
|
|
118
|
+
To use the visualizer with the server, you can hit:
|
|
119
|
+
https://signwriting-sxie2r74ua-uc.a.run.app//visualizer?fsw=M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475
|
|
120
|
+
|
|
121
|
+
### `signwriting.utils`
|
|
122
|
+
|
|
123
|
+
This module includes general utilities that were not covered in the other modules.
|
|
124
|
+
|
|
125
|
+
1. `join_signs` joins a list of signs into a single sign.
|
|
126
|
+
This is useful for example for fingerspelling words out of individual character signs.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
from signwriting.utils.join_signs import join_signs_vertical
|
|
130
|
+
|
|
131
|
+
char_a = 'M507x507S1f720487x492'
|
|
132
|
+
char_b = 'M507x507S14720493x485'
|
|
133
|
+
result_sign = join_signs_vertical(char_a, char_b)
|
|
134
|
+
# M510x518S1f720490x481S14720496x496
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### `signwriting.fingerspelling`
|
|
139
|
+
|
|
140
|
+
This module is used to generate spelling data from a list of characters.
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from signwriting.fingerspelling.fingerspelling import spell
|
|
144
|
+
|
|
145
|
+
word = "Hello" # any string of characters
|
|
146
|
+
language = "en-us-ase-asl" # long language code, as defined in the fingerspelling README
|
|
147
|
+
spell(word, language)
|
|
148
|
+
# M515x563S11502477x437S14a20492x457S1dc20484x477S1dc20484x512S17620492x547
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
To use the fingerspelling with the server, you can hit:
|
|
152
|
+
https://signwriting-sxie2r74ua-uc.a.run.app//fingerspelling?text=hello&signed_language=ase
|
|
153
|
+
|
|
154
|
+
### `signwriting.mouthing`
|
|
155
|
+
|
|
156
|
+
This module is used to generate SpeechWriting from spoken words.
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from signwriting.mouthing.mouthing import mouth
|
|
160
|
+
|
|
161
|
+
word = "Hello" # any string of characters, preferably valid words
|
|
162
|
+
language = "eng-Latn" # supported languages under "Language Support" at https://pypi.org/project/epitran/
|
|
163
|
+
mouth(word, language)
|
|
164
|
+
# M557x518S34700443x482S35c00469x482S34400495x482S34d00521x482
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Note: Installing English support for `epitran` requires extra steps,
|
|
168
|
+
see "Install flite" at [mouthing/README.md](signwriting/mouthing/README.md).
|
|
169
|
+
|
|
170
|
+
To use the mouthing with the server, you can hit:
|
|
171
|
+
https://signwriting-sxie2r74ua-uc.a.run.app//mouthing?text=hello&spoken_language=eng-Latn
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## Cite
|
|
175
|
+
|
|
176
|
+
```bibtex
|
|
177
|
+
@misc{moryossef2024-signwriting,
|
|
178
|
+
title={Utilities for SignWriting},
|
|
179
|
+
author={Moryossef, Amit},
|
|
180
|
+
howpublished={\url{https://github.com/sign-language-processing/signwriting}},
|
|
181
|
+
year={2024}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## References
|
|
186
|
+
|
|
187
|
+
[^1]: Amit Moryossef, Zifan Jiang.
|
|
188
|
+
|
|
189
|
+
2023. [SignBank+: Preparing a Multilingual Sign Language Dataset for Machine Translation Using Large Language Models](https://arxiv.org/abs/2309.11566).
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# SignWriting
|
|
2
|
+
|
|
3
|
+
Python utilities for SignWriting.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install git+https://github.com/sign-language-processing/signwriting
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with Docker:
|
|
12
|
+
```shell
|
|
13
|
+
docker build --platform linux/amd64 --tag signwriting:python .
|
|
14
|
+
docker run --platform linux/amd64 --rm -p 9090:8080 -e PORT=8080 signwriting:python
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Utilities
|
|
18
|
+
|
|
19
|
+
### `signwriting.formats`
|
|
20
|
+
|
|
21
|
+
This module provides utilities for converting between different formats of SignWriting.
|
|
22
|
+
We include a few examples:
|
|
23
|
+
|
|
24
|
+
1. To parse an FSW string into a [`Sign`](signwriting/types.py) object, representing the sign as a dictionary:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from signwriting.formats.fsw_to_sign import fsw_to_sign
|
|
28
|
+
|
|
29
|
+
fsw_to_sign("M123x456S1f720487x492")
|
|
30
|
+
# {'box': {'symbol': 'M', 'position': (123, 456)}, 'symbols': [{'symbol': 'S1f720', 'position': (487, 492)}]}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. To convert a SignWriting string in SWU format to FSW format:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from signwriting.formats.swu_to_fsw import swu2fsw
|
|
37
|
+
|
|
38
|
+
swu2fsw('𝠃𝤟𝤩𝣵𝤐𝤇𝣤𝤐𝤆𝣮𝣭')
|
|
39
|
+
# M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### `signwriting.tokenizer`
|
|
43
|
+
|
|
44
|
+
This module provides utilities for tokenizing SignWriting strings for use in NLP tasks[^1].
|
|
45
|
+
We include a few usage non-exhaustive examples:
|
|
46
|
+
|
|
47
|
+
1. To tokenize a SignWriting string into a list of tokens:
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from signwriting.tokenizer import SignWritingTokenizer
|
|
51
|
+
|
|
52
|
+
tokenizer = SignWritingTokenizer()
|
|
53
|
+
|
|
54
|
+
fsw = 'M123x456S1f720487x492S1f720487x492'
|
|
55
|
+
tokens = list(tokenizer.text_to_tokens(fsw, box_position=True))
|
|
56
|
+
# ['M', 'p123', 'p456', 'S1f7', 'c2', 'r0', 'p487', 'p492', 'S1f7', 'c2', 'r0', 'p487', 'p492'])
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
2. To convert a list of tokens back to a SignWriting string:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
tokenizer.tokens_to_text(tokens)
|
|
63
|
+
# M123x456S1f720487x492S1f720487x492
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
3. For machine learning purposes, we can convert the tokens to a list of integers:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
tokenizer.tokenize(fsw, bos=False, eos=False)
|
|
70
|
+
# [6, 932, 932, 255, 678, 660, 919, 924, 255, 678, 660, 919, 924]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
4. Or to remove 'A' information, and separate signs by spaces, we can use:
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from signwriting.tokenizer import normalize_signwriting
|
|
77
|
+
|
|
78
|
+
normalize_signwriting(fsw)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### `signwriting.visualizer`
|
|
82
|
+
|
|
83
|
+
This module is used to visualize SignWriting strings as images.
|
|
84
|
+
Unlike [sutton-signwriting/font-db](https://github.com/sutton-signwriting/font-db/) which it is based on, this module
|
|
85
|
+
does not support custom styling. Benchmarks show that this module is ~5000x faster than the original implementation.
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
from signwriting.visualizer.visualize import signwriting_to_image
|
|
89
|
+
|
|
90
|
+
fsw = "AS10011S10019S2e704S2e748M525x535S2e748483x510S10011501x466S20544510x500S10019476x475"
|
|
91
|
+
signwriting_to_image(fsw)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
To use the visualizer with the server, you can hit:
|
|
97
|
+
https://signwriting-sxie2r74ua-uc.a.run.app//visualizer?fsw=M525x535S2e748483x510S10011501x466S2e704510x500S10019476x475
|
|
98
|
+
|
|
99
|
+
### `signwriting.utils`
|
|
100
|
+
|
|
101
|
+
This module includes general utilities that were not covered in the other modules.
|
|
102
|
+
|
|
103
|
+
1. `join_signs` joins a list of signs into a single sign.
|
|
104
|
+
This is useful for example for fingerspelling words out of individual character signs.
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from signwriting.utils.join_signs import join_signs_vertical
|
|
108
|
+
|
|
109
|
+
char_a = 'M507x507S1f720487x492'
|
|
110
|
+
char_b = 'M507x507S14720493x485'
|
|
111
|
+
result_sign = join_signs_vertical(char_a, char_b)
|
|
112
|
+
# M510x518S1f720490x481S14720496x496
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
### `signwriting.fingerspelling`
|
|
117
|
+
|
|
118
|
+
This module is used to generate spelling data from a list of characters.
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from signwriting.fingerspelling.fingerspelling import spell
|
|
122
|
+
|
|
123
|
+
word = "Hello" # any string of characters
|
|
124
|
+
language = "en-us-ase-asl" # long language code, as defined in the fingerspelling README
|
|
125
|
+
spell(word, language)
|
|
126
|
+
# M515x563S11502477x437S14a20492x457S1dc20484x477S1dc20484x512S17620492x547
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
To use the fingerspelling with the server, you can hit:
|
|
130
|
+
https://signwriting-sxie2r74ua-uc.a.run.app//fingerspelling?text=hello&signed_language=ase
|
|
131
|
+
|
|
132
|
+
### `signwriting.mouthing`
|
|
133
|
+
|
|
134
|
+
This module is used to generate SpeechWriting from spoken words.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
from signwriting.mouthing.mouthing import mouth
|
|
138
|
+
|
|
139
|
+
word = "Hello" # any string of characters, preferably valid words
|
|
140
|
+
language = "eng-Latn" # supported languages under "Language Support" at https://pypi.org/project/epitran/
|
|
141
|
+
mouth(word, language)
|
|
142
|
+
# M557x518S34700443x482S35c00469x482S34400495x482S34d00521x482
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Note: Installing English support for `epitran` requires extra steps,
|
|
146
|
+
see "Install flite" at [mouthing/README.md](signwriting/mouthing/README.md).
|
|
147
|
+
|
|
148
|
+
To use the mouthing with the server, you can hit:
|
|
149
|
+
https://signwriting-sxie2r74ua-uc.a.run.app//mouthing?text=hello&spoken_language=eng-Latn
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## Cite
|
|
153
|
+
|
|
154
|
+
```bibtex
|
|
155
|
+
@misc{moryossef2024-signwriting,
|
|
156
|
+
title={Utilities for SignWriting},
|
|
157
|
+
author={Moryossef, Amit},
|
|
158
|
+
howpublished={\url{https://github.com/sign-language-processing/signwriting}},
|
|
159
|
+
year={2024}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## References
|
|
164
|
+
|
|
165
|
+
[^1]: Amit Moryossef, Zifan Jiang.
|
|
166
|
+
|
|
167
|
+
2023. [SignBank+: Preparing a Multilingual Sign Language Dataset for Machine Translation Using Large Language Models](https://arxiv.org/abs/2309.11566).
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "signwriting"
|
|
3
|
+
description = "Python utilities for SignWriting."
|
|
4
|
+
version = "v0.1.1"
|
|
5
|
+
authors = [
|
|
6
|
+
{ name = "Amit Moryossef", email = "amitmoryossef@gmail.com" }
|
|
7
|
+
]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"Pillow"
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[project.optional-dependencies]
|
|
14
|
+
dev = [
|
|
15
|
+
"pytest",
|
|
16
|
+
"pylint",
|
|
17
|
+
"numpy", # to test visualizer
|
|
18
|
+
]
|
|
19
|
+
mouthing = [
|
|
20
|
+
# For IPA transliteration
|
|
21
|
+
"epitran",
|
|
22
|
+
"g2pk"
|
|
23
|
+
]
|
|
24
|
+
server = [
|
|
25
|
+
# For API server
|
|
26
|
+
"Flask",
|
|
27
|
+
"Flask-RESTful",
|
|
28
|
+
"Flask-Cors",
|
|
29
|
+
"gunicorn"
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[tool.yapf]
|
|
33
|
+
based_on_style = "google"
|
|
34
|
+
column_limit = 120
|
|
35
|
+
|
|
36
|
+
[tool.pylint]
|
|
37
|
+
max-line-length = 120
|
|
38
|
+
disable = [
|
|
39
|
+
"C0103", # Invalid variable name (doesn't conform to UPPER_CASE naming style)
|
|
40
|
+
"C0114", # Missing module docstring
|
|
41
|
+
"C0115", # Missing class docstring
|
|
42
|
+
"C0116", # Missing function or method docstring
|
|
43
|
+
"C3001", # Lambda expression assigned to a variable
|
|
44
|
+
"R0911", # Too many return statements
|
|
45
|
+
"R0917", # Too many positional arguments
|
|
46
|
+
"W0511", # TODO
|
|
47
|
+
]
|
|
48
|
+
good-names = ["i", "f", "x", "y"]
|
|
49
|
+
|
|
50
|
+
[tool.setuptools]
|
|
51
|
+
packages = [
|
|
52
|
+
"signwriting",
|
|
53
|
+
"signwriting.formats",
|
|
54
|
+
"signwriting.tokenizer",
|
|
55
|
+
"signwriting.utils",
|
|
56
|
+
"signwriting.visualizer",
|
|
57
|
+
"signwriting.fingerspelling",
|
|
58
|
+
"signwriting.mouthing"
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.package-data]
|
|
62
|
+
signwriting = ["**/*.ttf", "**/*.txt", "**/*.json"]
|
|
63
|
+
|
|
64
|
+
[tool.pytest.ini_options]
|
|
65
|
+
addopts = "-v"
|
|
66
|
+
testpaths = ["signwriting"]
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Fingerspelling DTS (Dansk Tegnsprog/Danish Sign Language)
|
|
2
|
+
#
|
|
3
|
+
# The FSW for all the entered symbols are:
|
|
4
|
+
|
|
5
|
+
A,M510x508S1f720490x493
|
|
6
|
+
B,M507x511S14720493x489
|
|
7
|
+
C,M509x510S16d20492x490
|
|
8
|
+
D,M508x515S10120492x485
|
|
9
|
+
E,M508x508S14a20493x493
|
|
10
|
+
F,M509x515S1d820492x486
|
|
11
|
+
G,M515x508S1f000486x493
|
|
12
|
+
H,M515x508S11502485x493
|
|
13
|
+
I,M511x510S19220490x491
|
|
14
|
+
J,M519x518S19220498x499S2a20c482x483
|
|
15
|
+
K,M515x515S14020486x485
|
|
16
|
+
L,M512x515S1dc20488x485
|
|
17
|
+
M,M510x513S18d50490x488
|
|
18
|
+
N,M511x513S11950489x487
|
|
19
|
+
O,M508x508S17620492x492
|
|
20
|
+
P,M515x508S10112485x492
|
|
21
|
+
Q,M515x512S1f051485x489
|
|
22
|
+
R,M508x515S11a20493x485
|
|
23
|
+
S,M508x508S20320493x493
|
|
24
|
+
T,M515x509S1f220485x491
|
|
25
|
+
U,M508x515S11520493x485
|
|
26
|
+
V,M508x515S10e20493x485
|
|
27
|
+
W,M509x515S18720491x486
|
|
28
|
+
X,M511x513S10620490x487
|
|
29
|
+
Y,M514x510S19a20486x490
|
|
30
|
+
Z,M518x517S10020482x487S2450a487x483
|
|
31
|
+
Æ,M513x516S15020488x485
|
|
32
|
+
Ø,M508x517S17620492x501S22a00493x483
|
|
33
|
+
Å,M514x521S1f720490x506S2e302487x480
|
|
34
|
+
1,M508x512S1f502493x488
|
|
35
|
+
2,M512x515S1dc01489x485
|
|
36
|
+
3,M513x515S11e01488x485
|
|
37
|
+
4,M514x515S14401486x486
|
|
38
|
+
5,M513x514S14c01487x487
|
|
39
|
+
6,M509x515S18720491x486
|
|
40
|
+
7,M511x514S1a520490x486
|
|
41
|
+
8,M511x514S1bb20490x486
|
|
42
|
+
9,M511x515S1ce20489x485
|
|
43
|
+
0,M511x515S1ce10489x485
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# DSGS - Swiss German
|
|
2
|
+
A,M510x507S1f720490x492
|
|
3
|
+
B,M507x511S14720493x489
|
|
4
|
+
C,M509x510S16d20492x490
|
|
5
|
+
D,M508x515S10120492x485
|
|
6
|
+
E,M508x508S14a20493x493
|
|
7
|
+
F,M511x515S1ce20489x485
|
|
8
|
+
G,M515x508S1f000486x493
|
|
9
|
+
H,M515x508S11502485x493
|
|
10
|
+
I,M511x510S19220490x491
|
|
11
|
+
J,M520x519S19220499x500S2a20c481x482
|
|
12
|
+
K,M515x515S14020486x485
|
|
13
|
+
L,M512x515S1dc20488x485
|
|
14
|
+
M,M510x513S18d20490x488
|
|
15
|
+
N,M511x513S11920490x487
|
|
16
|
+
O,M508x508S17620492x492
|
|
17
|
+
P,M516x512S14001485x488
|
|
18
|
+
Q,M515x512S1f021485x489
|
|
19
|
+
R,M508x515S11a20493x485
|
|
20
|
+
S,M508x508S20320493x493
|
|
21
|
+
T,M512x511S1ea20489x490
|
|
22
|
+
U,M508x515S11520493x485
|
|
23
|
+
V,M508x515S10e20493x485
|
|
24
|
+
W,M509x515S18720491x486
|
|
25
|
+
X,M511x513S10620490x487
|
|
26
|
+
Y,M514x510S19a20486x490
|
|
27
|
+
Z,M519x519S10020482x489S2450a488x482
|
|
28
|
+
Ü,M513x519S11520496x489S22114487x481
|
|
29
|
+
¨,M512x516S14c20489x485
|
|
30
|
+
Ö,M513x513S17620493x497S22114487x488
|
|
31
|
+
Ä,M513x513S1f720487x498S22114487x488
|
|
32
|
+
^,M512x512S12820489x488
|
|
33
|
+
1,M508x512S1f502493x488
|
|
34
|
+
2,M512x515S1dc01489x485
|
|
35
|
+
3,M513x515S11e01488x485
|
|
36
|
+
4,M514x515S14401486x486
|
|
37
|
+
5,M513x514S14c01487x487
|
|
38
|
+
6,M520x516S14c08481x485S1f502505x492
|
|
39
|
+
7,M524x516S14c08477x485S1dc01501x486
|
|
40
|
+
8,M524x516S14c08477x485S11e00501x486
|
|
41
|
+
9,M523x516S14c08477x485S14400501x485
|
|
42
|
+
0,M524x516S14c00501x485S14c08477x485
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# DGS - German
|
|
2
|
+
SCH,M512x507S14c20489x476
|
|
3
|
+
SS,M526x508S20320492x492S26506511x494,M513x507S20320492x492S23108487x470
|
|
4
|
+
ß,M513x507S20320492x492S23108487x470,M508x519S20320493x482S22a04495x504
|
|
5
|
+
Ä,M517x507S23108491x472S1f720488x492
|
|
6
|
+
ä,M517x507S23108491x472S1f720488x492
|
|
7
|
+
Ö,M515x507S17610492x491S23108489x469
|
|
8
|
+
ö,M515x507S17610492x491S23108489x469
|
|
9
|
+
Ü,M515x507S11520493x477S23108489x456
|
|
10
|
+
ü,M515x507S11520493x477S23108489x456
|
|
11
|
+
A,M508x507S1f720488x492
|
|
12
|
+
B,M507x507S14720493x485
|
|
13
|
+
C,M508x507S16d10491x487
|
|
14
|
+
D,M508x507S10120492x477,M508x515S10110492x485
|
|
15
|
+
E,M508x507S14a20493x492
|
|
16
|
+
F,M514x507S1ce20492x477,M511x515S1ce10489x485
|
|
17
|
+
G,M507x507S10002477x492
|
|
18
|
+
H,M507x507S11502477x492
|
|
19
|
+
I,M513x507S19220492x488
|
|
20
|
+
J,M513x507S19220492x488S2a20c472x468
|
|
21
|
+
K,M507x507S14020478x477
|
|
22
|
+
L,M507x507S1dc20483x477
|
|
23
|
+
M,M507x507S18d50487x482
|
|
24
|
+
N,M507x507S11950485x481
|
|
25
|
+
O,M508x508S17610492x492,M508x508S17610492x492
|
|
26
|
+
P,M507x507S14050478x477
|
|
27
|
+
Q,M509x507S1f057486x477
|
|
28
|
+
R,M507x507S11a20492x477
|
|
29
|
+
S,M507x507S20320492x492
|
|
30
|
+
T,M515x509S1f210485x491
|
|
31
|
+
U,M507x507S11520492x477
|
|
32
|
+
V,M507x507S10e20492x477
|
|
33
|
+
W,M509x507S18720491x478
|
|
34
|
+
X,M507x507S10610492x481
|
|
35
|
+
Y,M513x507S19a20485x487
|
|
36
|
+
Z,M531x507S10020492x477S2450a500x468
|
|
37
|
+
1,M508x512S1f502493x488
|
|
38
|
+
2,M512x515S1dc00488x485
|
|
39
|
+
3,M511x515S11e00488x485
|
|
40
|
+
4,M511x516S14400489x485
|
|
41
|
+
5,M511x515S14c00488x484
|
|
42
|
+
6,M520x516S14c08481x485S1f502505x492
|
|
43
|
+
7,M524x516S14c08476x485S1dc00500x486
|
|
44
|
+
8,M524x516S14c08477x485S11e00501x486
|
|
45
|
+
9,M523x516S14c08477x485S14400501x485
|
|
46
|
+
0,M524x516S14c08477x485S14c00501x485
|
|
47
|
+
@,M533x559S34a00467x482S35d00497x482S15d48475x531S18510497x544S20b00498x526
|
|
48
|
+
.,M509x526S2f900496x474S26500495x483S10050492x496
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Fingerspelling BSL (British Sign Language)
|
|
2
|
+
#
|
|
3
|
+
# The FSW for all the entered symbols are:
|
|
4
|
+
A,M514x517S14c09488x490S20500486x483
|
|
5
|
+
B,M522x515S1ce10500x485S1ce18477x485
|
|
6
|
+
C,M511x509S1ec10488x490
|
|
7
|
+
D,M514x519S10018486x489S1ec10491x481
|
|
8
|
+
E,M513x520S14c09487x493S20500498x479
|
|
9
|
+
F,M516x517S1155a484x484S11550501x487
|
|
10
|
+
G,M507x516S20302492x484S2030a492x501
|
|
11
|
+
H,M525x520S15a39474x494S15a51477x497S20e00501x493S26507512x479
|
|
12
|
+
I,M517x517S14c07482x491S20500507x482
|
|
13
|
+
J,M522x521S14c08478x482S10012492x479S23803502x498
|
|
14
|
+
K,M515x521S10018484x491S10613487x478
|
|
15
|
+
L,M519x518S15a39480x483S10051489x497
|
|
16
|
+
M,M519x519S15a37481x481S18c51493x493
|
|
17
|
+
N,M519x516S15a39481x483S11551492x491
|
|
18
|
+
O,M519x514S14c09482x487S20500509x490
|
|
19
|
+
P,M513x524S10018487x494S1ce10491x475
|
|
20
|
+
Q,M523x528S1ce18477x472S10620496x502S20a00505x484
|
|
21
|
+
R,M517x517S15a39483x483S10641494x489
|
|
22
|
+
S,M520x519S19809480x480S19821500x492S20800510x482
|
|
23
|
+
T,M522x515S15a49478x484S10051492x494
|
|
24
|
+
U,M517x514S14c09482x487S20500507x500
|
|
25
|
+
V,M518x516S15a39482x483S10e51488x491
|
|
26
|
+
W,M527x522S14c11501x495S14c19473x495S20700491x478
|
|
27
|
+
X,M517x515S10019483x485S10011496x485
|
|
28
|
+
Y,M514x527S15d28485x473S10020499x497
|
|
29
|
+
Z,M518x516S15a18482x484S18210495x501
|
|
30
|
+
1,M507x515S10000492x485
|
|
31
|
+
2,M507x515S10e00492x485
|
|
32
|
+
3,M512x515S11e00489x485
|
|
33
|
+
4,M511x516S14400489x485
|
|
34
|
+
5,M512x515S14c00489x484
|
|
35
|
+
6,M510x511S1f801490x489
|
|
36
|
+
7,M512x515S1dc01489x485
|
|
37
|
+
8,M513x515S11e01488x485
|
|
38
|
+
9,M513x513S18e01487x487
|
|
39
|
+
0,M508x508S17610492x492
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Fingerspelling ISL (Teanga Chomharthaíochta na hÉireann: Irish Sign Language)
|
|
2
|
+
#
|
|
3
|
+
# The FSW for all the entered symbols are:
|
|
4
|
+
|
|
5
|
+
A,M508x512S1f540493x488
|
|
6
|
+
B,M507x511S14720493x489
|
|
7
|
+
C,M509x510S16d10492x490
|
|
8
|
+
D,M508x515S10110492x485
|
|
9
|
+
E,M508x508S14a20493x493
|
|
10
|
+
F,M515x514S1d210486x486
|
|
11
|
+
G,M511x515S1ce10489x485
|
|
12
|
+
H,M510x515S1a020490x486
|
|
13
|
+
I,M511x510S19220490x491
|
|
14
|
+
J,M519x518S19220498x499S2a20c482x483
|
|
15
|
+
K,M511x514S1bb20490x486
|
|
16
|
+
L,M510x514S15d20491x487
|
|
17
|
+
M,M510x513S18d50490x488
|
|
18
|
+
N,M511x513S11950489x487
|
|
19
|
+
O,M508x508S17610492x492
|
|
20
|
+
P,M508x515S18c20493x485
|
|
21
|
+
Q,M511x514S1a520490x486
|
|
22
|
+
R,M508x515S11a20493x485
|
|
23
|
+
S,M508x508S20320493x493
|
|
24
|
+
T,M512x511S1ea20489x490
|
|
25
|
+
U,M508x515S11520493x485
|
|
26
|
+
V,M508x515S10e20493x485
|
|
27
|
+
W,M509x515S18620491x485
|
|
28
|
+
X,M508x522S10640493x496S26504494x479
|
|
29
|
+
Y,M514x510S19a20486x490
|
|
30
|
+
Z,M518x517S10050482x487S2450a487x483
|
|
31
|
+
1,M508x515S10000493x485
|
|
32
|
+
2,M511x515S1de01490x485
|
|
33
|
+
3,M513x515S11e01488x485
|
|
34
|
+
4,M511x516S14400489x485
|
|
35
|
+
5,M512x516S14c00489x485
|
|
36
|
+
6,M524x520S14c09477x481S1f527502x498S20500491x503
|
|
37
|
+
7,M524x520S14c09476x481S1dc27501x490S20500490x503
|
|
38
|
+
8,M524x521S14c09476x480S20500488x501S11e27499x491
|
|
39
|
+
9,M527x518S14c09473x483S20500491x505S14421498x490
|
|
40
|
+
0,M524x519S14c09476x481S20500487x504S14c27498x492
|