silabificador 1.0.0__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.
- silabificador-1.0.0/PKG-INFO +14 -0
- silabificador-1.0.0/README.md +44 -0
- silabificador-1.0.0/setup.cfg +4 -0
- silabificador-1.0.0/setup.py +44 -0
- silabificador-1.0.0/silabificador/__init__.py +27 -0
- silabificador-1.0.0/silabificador/syl.py +1203 -0
- silabificador-1.0.0/silabificador/version.py +10 -0
- silabificador-1.0.0/silabificador.egg-info/PKG-INFO +14 -0
- silabificador-1.0.0/silabificador.egg-info/SOURCES.txt +9 -0
- silabificador-1.0.0/silabificador.egg-info/dependency_links.txt +1 -0
- silabificador-1.0.0/silabificador.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: silabificador
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A syllabifier for Portuguese
|
|
5
|
+
Author: JarbasAI
|
|
6
|
+
Author-email: jarbasai@mailfence.com
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Dynamic: author
|
|
11
|
+
Dynamic: author-email
|
|
12
|
+
Dynamic: classifier
|
|
13
|
+
Dynamic: requires-python
|
|
14
|
+
Dynamic: summary
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# 🧩 Silabificador
|
|
2
|
+
|
|
3
|
+
A lightweight Portuguese syllabifier built with hand crafted rules
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📦 Features
|
|
8
|
+
|
|
9
|
+
- Syllabification tuned for **Portuguese**.
|
|
10
|
+
- Tested on clean, well-structured data from the [Portal da LÃngua Portuguesa](http://www.portaldalinguaportuguesa.org).
|
|
11
|
+
- no dependencies
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 🚀 Installation
|
|
16
|
+
|
|
17
|
+
Install directly from GitHub:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install git+https://github.com/TigreGotico/silabificador
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🧠Usage
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from silabificador import syllabify
|
|
29
|
+
|
|
30
|
+
print(syllabify("computador"))
|
|
31
|
+
# Output: ['com', 'pu', 'ta', 'dor']
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 📚 Dataset
|
|
37
|
+
|
|
38
|
+
This project was benchmarked on the [📚 Portuguese Phonetic Lexicon Dataset](https://huggingface.co/datasets/TigreGotico/portuguese_phonetic_lexicon), which contains over 100,000 entries sourced from the [Portal da LÃngua Portuguesa](http://www.portaldalinguaportuguesa.org).
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 📄 License
|
|
43
|
+
|
|
44
|
+
MIT License
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from setuptools import setup, find_packages
|
|
3
|
+
|
|
4
|
+
BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_version():
|
|
8
|
+
""" Find the version of the package"""
|
|
9
|
+
version_file = os.path.join(BASEDIR, 'silabificador', 'version.py')
|
|
10
|
+
major, minor, build, alpha = (None, None, None, None)
|
|
11
|
+
with open(version_file) as f:
|
|
12
|
+
for line in f:
|
|
13
|
+
if 'VERSION_MAJOR' in line:
|
|
14
|
+
major = line.split('=')[1].strip()
|
|
15
|
+
elif 'VERSION_MINOR' in line:
|
|
16
|
+
minor = line.split('=')[1].strip()
|
|
17
|
+
elif 'VERSION_BUILD' in line:
|
|
18
|
+
build = line.split('=')[1].strip()
|
|
19
|
+
elif 'VERSION_ALPHA' in line:
|
|
20
|
+
alpha = line.split('=')[1].strip()
|
|
21
|
+
|
|
22
|
+
if ((major and minor and build and alpha) or
|
|
23
|
+
'# END_VERSION_BLOCK' in line):
|
|
24
|
+
break
|
|
25
|
+
version = f"{major}.{minor}.{build}"
|
|
26
|
+
if alpha and int(alpha) > 0:
|
|
27
|
+
version += f"a{alpha}"
|
|
28
|
+
return version
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
setup(
|
|
32
|
+
name="silabificador",
|
|
33
|
+
version=get_version(),
|
|
34
|
+
description="A syllabifier for Portuguese",
|
|
35
|
+
author="JarbasAI",
|
|
36
|
+
author_email="jarbasai@mailfence.com",
|
|
37
|
+
packages=find_packages(),
|
|
38
|
+
include_package_data=True,
|
|
39
|
+
classifiers=[
|
|
40
|
+
"Programming Language :: Python :: 3",
|
|
41
|
+
"License :: OSI Approved :: MIT License"
|
|
42
|
+
],
|
|
43
|
+
python_requires=">=3.7",
|
|
44
|
+
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import List, Optional, Tuple, Any
|
|
3
|
+
from silabificador.syl import syllabify
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Syllabifier:
|
|
7
|
+
"""
|
|
8
|
+
A Portuguese syllabifier that uses a trained Brill tagger model to split words into syllables.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
def syllabify(self, word: str) -> List[str]:
|
|
12
|
+
"""
|
|
13
|
+
Split a Portuguese word into syllables using IOB tagging.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
word (str): The input word to be syllabified.
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
List[str]: A list of syllables as strings.
|
|
20
|
+
"""
|
|
21
|
+
return syllabify(word)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if __name__ == "__main__":
|
|
25
|
+
s = Syllabifier()
|
|
26
|
+
print(s.syllabify("computador"))
|
|
27
|
+
# ['com', 'pu', 'ta', 'dor']
|