apertium / apertium/apertium-python
Make it easy to use a local / non-installed repo
- Lenguaje dominante
- Python
- Estrellas
- 35
- Forks
- 27
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
It's not at all clear how to use existing compiled modules. e.g. I have `apertium-quc` on my local system, how do I add that repo to be able to use it?
I tried:
```
>>> apertium.search_path('/home/fran/source/apertium/languages')
```
And it returns some stuff but doesn't seem to change state:
```
>>> apertium.analyze('quc-morph', 'we')
Traceback (most recent call last):
File "", line 1, in
File "/home/fran/source/apertium/trunk/apertium-python/apertium/analysis/__init__.py", line 84, in analyze
analyzer: Analyzer = Analyzer(lang)
File "/home/fran/source/apertium/trunk/apertium-python/apertium/analysis/__init__.py", line 25, in __init__
raise apertium.ModeNotInstalled(self.lang)
apertium.ModeNotInstalled: quc-morph
```
Probably the ideal thing would be to had something like:
```python
>>> apertium.load_module('/home/fran/source/apertium/languages/apertium-quc')
```
But the whole way this works is kind of confusing in general.
I also tried:
```
>>> apertium.append_pair_path('/home/fran/source/apertium/languages/apertium-quc')
>>> apertium.analyze('quc-morph', 'we')
Traceback (most recent call last):
File "", line 1, in
File "/home/fran/source/apertium/trunk/apertium-python/apertium/analysis/__init__.py", line 84, in analyze
analyzer: Analyzer = Analyzer(lang)
File "/home/fran/source/apertium/trunk/apertium-python/apertium/analysis/__init__.py", line 25, in __init__
raise apertium.ModeNotInstalled(self.lang)
apertium.ModeNotInstalled: quc-morph
>>> apertium.Analyzer('quc')
>>> a = apertium.Analyzer('quc')
>>> a.analyse('we')
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'Analyzer' object has no attribute 'analyse'
>>> a.analyze('we')
sed: -e expressió #1, caràcter 1: ordre desconeguda: «"»
[]
```
So, `sed` doesn't seem to work, and the naming of `append_pair_path()` is strange, it should probably be just `register_module()` or `load_module()`.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza en apertium/analysis/__init__.py y sigue search_path(), append_pair_path(), Analyzer y analyze() usando los ejemplos reproducidos de apertium-quc. Aclara cómo se descubren los módulos compilados localmente y define cómo deberían ser un registro y un análisis correctos, incluyendo el fallo de sed indicado y la confusa nomenclatura de la API.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- developer-experience
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100