Bug #2709
RCP: 0.8.0, Import is stuck if the corpus name consists only of cyrillic characters
Statut: | Closed | Début: | 08/01/2020 | |
---|---|---|---|---|
Priorité: | High | Echéance: | ||
Assigné à: | - | % réalisé: | 100% |
|
Catégorie: | Import | Temps passé: | - | |
Version cible: | TXM 0.8.1 |
Description
To reproduce the bug, create a source folder named "СИНДАРИН", place any XML or text file in it.
[note that the "С" and "А" characters are not the usual "C" and "A" ascii characters]
Then call any import module and select the "СИНДАРИН" folder.
TXM proposes "СИНДАРИН" for the corpus name.
Click OK.
The import process is stuck, no message appears on the console.
Close the import form, exit TXM.
Re-open TXM, set log level to "ALL" and try to start an import module.
The following message appears in the console:
"Checking corpus name validity with '[A-Z][-A-Z0-9]+': СИНДАРИН" and nothing else happens.
To restore the import capacity, you need to delete the user/TXM 0.8.0/.txm folder.
solution¶
- Do not build an invalid CQP corpus name if the folder name consists only of non ASCII characters (from the first UTF-8 plane)
- If the corpus name normalization process returns an empty sequence, display an error message and return to the corpus name definition stage
- EN "** corpus name normalization: no valid character available to build the corpus name (try to use some American English - ASCII - characters in the folder name)"
- FR "** normalisation du nom du corpus : aucun caractère valide disponible pour construire le nom du corpus (essayez d'utiliser des caractères anglais américain - ASCII - dans le nom du dossier)"
- Use transliteration/vocalization rules to build the normalized corpus name:
For example with International Component for Unicode for Java (ICU4J) (http://site.icu-project.org/home/why-use-icu4j, https://mvnrepository.com/artifact/com.ibm.icu/icu4j)
Groovy code:
1import com.ibm.icu.text.Transliterator
2
3cyrillic = "СИНДАРИН"
4id = "Any-Latin; NFD; Upper; [^\\p{Alnum}] Remove"
5latin = Transliterator.getInstance(id).transform(cyrillic)
6
7printf("translit(%s) = %s\n", cyrillic, latin)
gives:
translit(СИНДАРИН) = SINDARIN
Update AsciiUtils.converttoAscii() with the ICU tools
[adapted from https://stackoverflow.com/questions/5818912/icu4j-cyrillic-to-latin]
Révisions associées
fix AscciUtils.convertToAscii using ICU tools refs #2709
Historique
#1 Mis à jour par Serge Heiden il y a plus de 5 ans
- Sujet changé de RCP: 0.8.0, Import is stuck if the corpus name consists of cyrillic characters à RCP: 0.8.0, Import is stuck if the corpus name consists only of cyrillic characters
- Description mis à jour (diff)
#2 Mis à jour par Serge Heiden il y a plus de 5 ans
- Description mis à jour (diff)
- Priorité changé de Normal à High
#3 Mis à jour par Matthieu Decorde il y a plus de 5 ans
- Description mis à jour (diff)
- % réalisé changé de 0 à 70
#4 Mis à jour par Serge Heiden il y a plus de 5 ans
- Description mis à jour (diff)
#5 Mis à jour par Sebastien Jacquot il y a plus de 5 ans
- Version cible changé de TXM 0.8.2 à TXM 0.8.1
#6 Mis à jour par Matthieu Decorde il y a plus de 5 ans
- % réalisé changé de 70 à 80
#7 Mis à jour par Sebastien Jacquot il y a plus d'un an
- % réalisé changé de 80 à 100
#8 Mis à jour par Sebastien Jacquot il y a plus d'un an
- Statut changé de New à Closed