From: Pierre Ratinaud Date: Thu, 11 Dec 2014 22:03:47 +0000 (+0100) Subject: ... X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=46fe1c98d3c43f5bce9d8acb6d0ee24b5299fd85;p=iramuteq ... --- diff --git a/guifunct.py b/guifunct.py index 44d239c..eb000df 100644 --- a/guifunct.py +++ b/guifunct.py @@ -41,7 +41,7 @@ def OnOpen(self, type): elif type == "Texte": return False, [False] elif type == "Analyse": - return [False] + return False def getfileextension(file) : return os.path.splitext(file)[1] diff --git a/import_txm.py b/import_txm.py index 675a9c9..0dfd1eb 100644 --- a/import_txm.py +++ b/import_txm.py @@ -9,12 +9,6 @@ import os import xml.sax import glob - - -#infiledir = '/home/pierre/TXM/corpus/voeux-bin/txm/VOEUX/' -#fileout = 'VOEUXExportfromTXM.txt' - - class TXMParser(xml.sax.ContentHandler) : def __init__(self, fileout, encodage_out) : self.fileout = fileout @@ -63,17 +57,14 @@ class TXMParser(xml.sax.ContentHandler) : self.fileout.write(sent.encode(self.encodage_out)) self.sent = [] - - -class TXM2IRA : - def __init__(self, pathin, fileout, encodage_in, encodage_out) : +def TXM2IRA(pathin, fileout, encodage_in, encodage_out) : parser = xml.sax.make_parser() files = glob.glob(os.path.join(pathin,'*.xml')) + if len(files) == 0 : + return 'nofile' with open(fileout, 'w') as fout : parser.setContentHandler(TXMParser(fout, encodage_out)) for f in files : parser.parse(open(f, 'r')) fout.write('\n\n') - print 'done' - -#TXM2IRA(infiledir, fileout) + return None \ No newline at end of file diff --git a/iramuteq.py b/iramuteq.py index ea92ad5..157c0d6 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -182,6 +182,8 @@ images_analyses = { 'simimatrix' : 'simimatrix.png', 'simiclustermatrix' : 'simimatrix.png', 'proto' : 'proto.png', + 'TXM' : 'TXM.png', + 'europress' : 'europress.png', } ##################################################################### @@ -254,11 +256,11 @@ class IraFrame(wx.Frame): file_menu.AppendMenu(-1, _(u"Import from factiva").decode('utf8'), menuFactiva) item = wx.MenuItem(file_menu, ID_ImportTXM, _(u"Import from TXM").decode('utf8'), _(u"Import from TXM").decode('utf8')) - item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + item.SetBitmap(self.images_analyses['TXM']) file_menu.AppendItem(item) item = wx.MenuItem(file_menu, ID_ImportEuro, _(u"Import from Europress").decode('utf8'), _(u"Import from Europress").decode('utf8')) - item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + item.SetBitmap(self.images_analyses['europress']) file_menu.AppendItem(item) menuTools = wx.Menu() @@ -716,8 +718,9 @@ class IraFrame(wx.Frame): def OnOpenAnalyse(self, event): self.AnalysePath = OnOpen(self, "Analyse") - OpenAnalyse(self, self.AnalysePath[1][0], True) - self.ShowMenu('view') + if self.AnalysePath : + OpenAnalyse(self, self.AnalysePath[1][0], True) + self.ShowMenu('view') def OnOpenText(self, event): inputname, self.input_path = OnOpen(self, "Texte") diff --git a/iramuteq_fr_FR.po b/iramuteq_fr_FR.po index 064b0d6..b9e9fd8 100644 --- a/iramuteq_fr_FR.po +++ b/iramuteq_fr_FR.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: iramuteq 0.6 alpha 1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-12-09 00:28+0100\n" -"PO-Revision-Date: 2014-12-02 18:17+0200\n" +"POT-Creation-Date: 2014-12-11 13:56+0100\n" +"PO-Revision-Date: 2014-12-11 13:56+0200\n" "Last-Translator: Pierre Ratinaud \n" "Language-Team: LANGUAGE \n" "Language: fr\n" @@ -21,7 +21,7 @@ msgstr "" msgid "3D graph" msgstr "Graphe 3D" -#: iramuteq.py:294 +#: iramuteq.py:373 msgid "About..." msgstr "A propos..." @@ -49,7 +49,7 @@ msgstr "Ajouter la taille des classes" msgid "All segments" msgstr "Tous les segments" -#: layout.py:339 tree.py:444 tree.py:657 +#: layout.py:339 tree.py:407 tree.py:620 msgid "Antiprofiles" msgstr "Antiprofils" @@ -61,7 +61,7 @@ msgstr "Antonyme" msgid "Are you sure ?" msgstr "Êtes-vous sûr ?" -#: Liste.py:163 Liste.py:180 listlex.py:198 listlex.py:233 ProfList.py:308 +#: Liste.py:163 Liste.py:180 listlex.py:197 listlex.py:232 ProfList.py:308 #: ProfList.py:743 msgid "Associated forms" msgstr "Formes associées" @@ -102,6 +102,10 @@ msgstr "AFC Types" msgid "CA forms" msgstr "AFC sur les formes" +#: iramuteq.py:627 +msgid "Can't find R executable" +msgstr "Impossible de trouver l’exécutable de R." + #: dialog.py:2376 msgid "Change ..." msgstr "Changer ..." @@ -110,7 +114,7 @@ msgstr "Changer ..." msgid "Characteristic text segments" msgstr "Segments de texte caractéristiques" -#: dialog.py:82 dialog.py:2313 dialog.py:2706 layout.py:1030 +#: dialog.py:82 dialog.py:2313 dialog.py:2705 layout.py:1030 msgid "Characters set" msgstr "Encodage" @@ -134,7 +138,7 @@ msgstr "" "Vérifier l'installation\n" "des libraires de R" -#: dialog.py:1481 iramuteq.py:261 +#: dialog.py:1481 iramuteq.py:290 msgid "Chi2" msgstr "Chi2" @@ -174,12 +178,12 @@ msgstr "Fermer" msgid "Cluster" msgstr "Classe" -#: dialog.py:1308 iramuteq.py:266 iramuteq.py:287 layout.py:526 -#: OptionAlceste.py:29 tree.py:399 +#: dialog.py:1308 iramuteq.py:291 iramuteq.py:338 layout.py:526 +#: OptionAlceste.py:29 msgid "Clustering" msgstr "Classification" -#: tree.py:454 tree.py:639 tree.py:648 +#: tree.py:417 tree.py:602 tree.py:611 msgid "Clusters statistics" msgstr "Statistiques des classes" @@ -187,7 +191,7 @@ msgstr "Statistiques des classes" msgid "Color or black and white" msgstr "Couleur ou noir et blanc" -#: tree.py:452 tree.py:612 +#: tree.py:415 tree.py:575 msgid "Colored corpus" msgstr "Corpus en couleur" @@ -199,11 +203,11 @@ msgstr "Séparateur de colonnes" msgid "Communities" msgstr "Communautés" -#: tree.py:450 tree.py:479 +#: tree.py:413 tree.py:442 msgid "Compute Tgen" msgstr "Calculer les TGen" -#: Liste.py:164 Liste.py:191 listlex.py:199 listlex.py:294 ProfList.py:321 +#: Liste.py:164 Liste.py:191 listlex.py:198 listlex.py:293 ProfList.py:321 #: ProfList.py:677 ProfList.py:683 ProfList.py:689 msgid "Concordance" msgstr "Concordancier" @@ -232,7 +236,7 @@ msgstr "Définition" msgid "Delete characters not in this list" msgstr "Éliminer les caractères en dehors de cette liste" -#: tree.py:492 +#: tree.py:455 msgid "Delete from history" msgstr "Supprimer de l'historique" @@ -252,7 +256,7 @@ msgstr "Description du corpus" msgid "Dictionary" msgstr "Dictionnaire" -#: tree.py:626 +#: tree.py:589 msgid "Done" msgstr "Fait" @@ -272,7 +276,7 @@ msgstr "Seuil pour les arêtes" msgid "Edges width proportional to score" msgstr "Largeur des arêtes proportionnelle à l'indice" -#: iramuteq.py:298 +#: iramuteq.py:377 msgid "Edition" msgstr "Edition" @@ -280,23 +284,23 @@ msgstr "Edition" msgid "Etymology" msgstr "Etymologie" -#: iramuteq.py:248 +#: iramuteq.py:277 msgid "Exit" msgstr "Quitter" -#: tree.py:456 +#: tree.py:419 msgid "Export clusters" msgstr "Exporter les classes" -#: tree.py:451 +#: tree.py:414 msgid "Export corpus" msgstr "Exporter le corpus" -#: tree.py:472 +#: tree.py:435 msgid "Export dictionary" msgstr "Exporter le dictionnaire" -#: dialog.py:2998 +#: dialog.py:2997 msgid "Export finished. Open in a web browser :" msgstr "Export terminé. Ouvrez ce lien dans un navigateur :" @@ -308,7 +312,7 @@ msgstr "Exporter pour ..." msgid "Export for Tropes" msgstr "Exporter pour Tropes" -#: tree.py:473 +#: tree.py:436 msgid "Export lemma dictionary" msgstr "Exporter le dictionnaire des lemmes" @@ -320,15 +324,15 @@ msgstr "Exporter..." msgid "Exporter for Owledge" msgstr "Exporter pour Owledge" -#: iramuteq.py:233 +#: iramuteq.py:262 msgid "Extract mods" msgstr "Extraire à partir des modalités" -#: iramuteq.py:234 +#: iramuteq.py:263 msgid "Extract thematics" msgstr "Extraire à partir des thématiques" -#: dialog.py:2737 +#: dialog.py:2736 msgid "Extraction type" msgstr "Type d'extraction" @@ -348,7 +352,7 @@ msgstr "Facteur y:" msgid "Factor z : " msgstr "Facteur z:" -#: iramuteq.py:297 +#: iramuteq.py:376 msgid "File" msgstr "Fichier" @@ -388,7 +392,7 @@ msgstr "Fréquences relatives des formes" msgid "Freq." msgstr "Freq." -#: iramuteq.py:259 +#: iramuteq.py:288 msgid "Frequencies" msgstr "Fréquences" @@ -412,7 +416,7 @@ msgstr "Graphe de la classe" msgid "Graph settings" msgstr "Paramètres du graphe" -#: dialog.py:3266 listlex.py:200 listlex.py:345 +#: dialog.py:3274 listlex.py:199 listlex.py:344 msgid "Graphic" msgstr "Graphique" @@ -432,27 +436,39 @@ msgstr "Nuance de gris des textes proportionnelle à la fréquence (0 = noir, 1 msgid "Hapax" msgstr "Hapax" -#: iramuteq.py:302 +#: iramuteq.py:381 msgid "Help" msgstr "Aide" -#: iramuteq.py:343 +#: iramuteq.py:441 msgid "Historic" msgstr "Historique" -#: iramuteq.py:254 +#: iramuteq.py:283 msgid "Home page" msgstr "Page d'accueil" -#: dialog.py:1869 dialog.py:3128 +#: iramuteq.py:629 +msgid "IRaMuTeQ does not work without R." +msgstr "IRaMuTeQ ne peut pas fonctionner sans R." + +#: iramuteq.py:628 +msgid "If R is installed, report its path in Preferences." +msgstr "Si R est installé, signalez son chemin dans les préférences." + +#: iramuteq.py:627 +msgid "If R is not installed, get it from http://www.r-project.org." +msgstr "Si n'est pas installé, vous pouvez l'obtenir à partir du site http://www.r-project.org." + +#: dialog.py:1869 dialog.py:3136 msgid "Image format" msgstr "Format de l'image" -#: iramuteq.py:227 +#: iramuteq.py:256 msgid "Import from TXM" msgstr "Importer de TXM" -#: iramuteq.py:225 +#: iramuteq.py:254 msgid "Import from factiva" msgstr "Importer de factiva" @@ -468,14 +484,22 @@ msgstr "Dans les segments de cette classe" msgid "In segments of this clustering" msgstr "Dans les segments de cette classification" -#: dialog.py:2831 +#: dialog.py:2830 msgid "Include empty cells (NA)" msgstr "Inclure les cellules vides (NA)" -#: tree.py:389 +#: tree.py:395 msgid "Informations" msgstr "Informations" +#: iramuteq.py:653 +msgid "Installation" +msgstr "Installation" + +#: iramuteq.py:653 +msgid "Installation OK" +msgstr "Installation OK" + #: dialog.py:369 msgid "Interface language" msgstr "Langue de l'interface" @@ -504,7 +528,7 @@ msgstr "Corpus lemmatisé" msgid "Lemmatization" msgstr "Lemmatisation" -#: iramuteq.py:1087 +#: iramuteq.py:1218 msgid "License GNU GPL" msgstr "Licence GNU GPL" @@ -516,7 +540,7 @@ msgstr "Comme ALCESTE" msgid "Like Lexico" msgstr "Comme Lexico" -#: dialog.py:2901 +#: dialog.py:2900 msgid "Limit frequency" msgstr "Fréquence limite" @@ -524,7 +548,7 @@ msgstr "Fréquence limite" msgid "Limit points by cluster chi2" msgstr "Limiter les points par le chi2 de liaison aux classes" -#: dialog.py:2921 +#: dialog.py:2920 msgid "Limit rank" msgstr "Rang limite" @@ -532,7 +556,7 @@ msgstr "Rang limite" msgid "List of not plotted points : " msgstr "Liste des points non-représentés" -#: listlex.py:210 ProfList.py:322 +#: listlex.py:209 ProfList.py:322 msgid "Make Tgen" msgstr "Faire un TGen" @@ -544,11 +568,11 @@ msgstr "Faire un film" msgid "Make text segments" msgstr "Faire des segments de texte" -#: tree.py:169 +#: iramuteq.py:399 tree.py:175 msgid "Matrix" msgstr "Matrice" -#: iramuteq.py:300 +#: iramuteq.py:379 msgid "Matrix analysis" msgstr "Analyses de matrice" @@ -588,7 +612,7 @@ msgstr "Moyenne de formes par segment" msgid "Mean of occurrences by text" msgstr "Moyenne d'occurrences par texte" -#: dialog.py:1739 dialog.py:2941 +#: dialog.py:1739 dialog.py:2940 msgid "Minimum frequency" msgstr "Fréquence minimale" @@ -612,7 +636,7 @@ msgstr "Taille minimum des segments" msgid "Minimum text segments frenquency in clusters (2= automatic)" msgstr "Nombre minimum de segments de texte par classe (2 = automatique)" -#: dialog.py:2728 +#: dialog.py:2727 msgid "Modalities (one by line, with the *)" msgstr "Modalités (une par ligne, avec l'étoile (*))" @@ -620,11 +644,15 @@ msgstr "Modalités (une par ligne, avec l'étoile (*))" msgid "Morphology" msgstr "Morphologie" -#: iramuteq.py:260 -msgid "Multiple frequencies" +#: iramuteq.py:289 +msgid "Multiple Frequencies" msgstr "Fréquences multiples" -#: tree.py:453 +#: dialog.py:3041 +msgid "Name" +msgstr "Nom" + +#: tree.py:416 msgid "Navigator" msgstr "Navigateur" @@ -632,7 +660,7 @@ msgstr "Navigateur" msgid "Next" msgstr "Suivant" -#: tree.py:720 +#: tree.py:683 msgid "No TGen yet !" msgstr "Pas encore de TGen !" @@ -692,35 +720,35 @@ msgstr "Nombre de segments de texte" msgid "Number of texts" msgstr "Nombre de textes" -#: dialog.py:2741 +#: dialog.py:2740 msgid "One file by modality" msgstr "Un fichier par modalité" -#: iramuteq.py:295 +#: iramuteq.py:374 msgid "Online help..." msgstr "Aide en ligne ..." -#: dialog.py:2741 +#: dialog.py:2740 msgid "Only one file" msgstr "Seulement un fichier" -#: tree.py:445 tree.py:487 +#: tree.py:408 tree.py:450 msgid "Open ..." msgstr "Ouvrir ..." -#: iramuteq.py:205 +#: iramuteq.py:233 iramuteq.py:399 msgid "Open a matrix" msgstr "Ouvrir une matrice" -#: iramuteq.py:209 +#: iramuteq.py:238 iramuteq.py:401 msgid "Open a text corpus" msgstr "Ouvrir un corpus texte" -#: iramuteq.py:213 +#: iramuteq.py:242 msgid "Open an analysis" msgstr "Ouvrir une Analyse" -#: tree.py:626 +#: tree.py:589 msgid "Open in a web browser ?" msgstr "Ouvrir dans un navigateur ?" @@ -744,7 +772,7 @@ msgstr "Types" msgid "POS frequencies" msgstr "Fréquences des types" -#: tree.py:448 +#: tree.py:411 msgid "POS profiles" msgstr "Profil des types grammaticaux" @@ -772,12 +800,12 @@ msgstr "Taille de l'image" msgid "Play a sound at the end of analysis" msgstr "Jouer un son à la fin des analyses" -#: corpus.py:1624 iramuteq.py:581 iramuteq.py:626 layout.py:946 tree.py:739 -#: tree.py:1063 +#: corpus.py:1624 iramuteq.py:706 iramuteq.py:755 layout.py:946 tree.py:702 +#: tree.py:1026 msgid "Please wait..." msgstr "Patientez ..." -#: tree.py:514 +#: tree.py:477 msgid "Please wait...Reading corpus" msgstr "Patientez... Lecture du corpus" @@ -785,7 +813,7 @@ msgstr "Patientez... Lecture du corpus" msgid "Potato mode (less precise, faster)" msgstr "Mode patate (moins précis, plus rapide)" -#: dialog.py:3085 iramuteq.py:251 +#: dialog.py:3093 iramuteq.py:280 msgid "Preferences" msgstr "Préférences" @@ -801,7 +829,7 @@ msgstr "Problème" msgid "Profiles" msgstr "Profils" -#: iramuteq.py:269 +#: iramuteq.py:294 msgid "Prototypical Analysis" msgstr "Analyses Prototypiques" @@ -825,7 +853,7 @@ msgstr "Chemin de R" msgid "Ranking score" msgstr "Indice de rang" -#: dialog.py:2878 +#: dialog.py:2877 msgid "Ranks" msgstr "Rangs" @@ -833,15 +861,15 @@ msgstr "Rangs" msgid "Reading profiles" msgstr "Lecture des profils" -#: iramuteq.py:308 +#: iramuteq.py:387 msgid "Ready" msgstr "Prêt" -#: iramuteq.py:264 iramuteq.py:285 tree.py:397 +#: iramuteq.py:292 iramuteq.py:339 msgid "Reinert's Method" msgstr "Méthode Reinert" -#: tree.py:390 +#: tree.py:396 msgid "Rename" msgstr "Renommer" @@ -849,7 +877,7 @@ msgstr "Renommer" msgid "Repeated segments" msgstr "Segments répétés" -#: dialog.py:1243 layout.py:519 tree.py:447 +#: dialog.py:1243 layout.py:519 tree.py:410 msgid "Repeated segments profiles" msgstr "Profils des segments répétés" @@ -861,7 +889,7 @@ msgstr "Remplacer les apostrophes par des espaces" msgid "Replace dash by space" msgstr "Remplacer les tirets par des espaces" -#: tree.py:455 tree.py:486 tree.py:666 tree.py:676 +#: tree.py:418 tree.py:449 tree.py:629 tree.py:639 msgid "Report" msgstr "Rapport" @@ -877,8 +905,7 @@ msgstr "Résultats" msgid "Save as ..." msgstr "Enregistrer sous ..." -#: dialog.py:3222 -#, fuzzy +#: dialog.py:3230 msgid "Save as..." msgstr "Enregistrer sous ..." @@ -890,7 +917,7 @@ msgstr "Indice" msgid "Score on edges" msgstr "Indices sur les arêtes" -#: tree.py:635 +#: tree.py:598 msgid "Search ..." msgstr "Rechercher ..." @@ -910,7 +937,7 @@ msgstr "Sélectionnez un répertoire contenant les fichiers txt" msgid "Select a directory of xml files" msgstr "Sélectionnez un répertoire contenant les fichiers xml" -#: dialog.py:2352 dialog.py:2701 +#: dialog.py:2352 dialog.py:2700 msgid "Select a file" msgstr "Sélectionnez un fichier" @@ -926,26 +953,30 @@ msgstr "Sélection par" msgid "Select columns" msgstr "Sélectionnez les colonnes" +#: dialog.py:3048 +msgid "Select one or more metadata" +msgstr "Sélectionnez une ou plusieurs méta-données" + #: dialog.py:330 dialog.py:469 dialog.py:970 dialog.py:1041 dialog.py:2149 -#: dialog.py:2279 dialog.py:2864 guifunct.py:161 OptionAlceste.py:63 +#: dialog.py:2279 dialog.py:2863 guifunct.py:161 OptionAlceste.py:63 msgid "Settings" msgstr "Paramètres" -#: iramuteq.py:255 +#: iramuteq.py:284 msgid "Show data" msgstr "Voir les données" -#: iramuteq.py:256 +#: iramuteq.py:285 msgid "Show results" msgstr "Voir les résultats" -#: iramuteq.py:268 iramuteq.py:288 tree.py:400 +#: iramuteq.py:293 iramuteq.py:340 msgid "Similarities Analysis" msgstr "Analyses de similitudes" -#: dialog.py:3093 +#: dialog.py:3101 msgid "Size" -msgstr "" +msgstr "Taille" #: OptionAlceste.py:31 msgid "Size of rst1" @@ -963,7 +994,7 @@ msgstr "Taille de rst2" msgid "Specificities" msgstr "Spécificités" -#: iramuteq.py:282 tree.py:395 +#: iramuteq.py:337 msgid "Specificities and CA" msgstr "Spécificités et AFC" @@ -971,38 +1002,38 @@ msgstr "Spécificités et AFC" msgid "Spheres transparency" msgstr "Transparence des sphéres" -#: iramuteq.py:232 tree.py:428 +#: iramuteq.py:261 iramuteq.py:295 msgid "Split from variable" msgstr "Sous corpus par variable" -#: tree.py:429 -msgid "Split matrix" -msgstr "Extraire de la matrice..." - #: layout.py:551 msgid "Stat by cluster" msgstr "Stat par classe" -#: iramuteq.py:281 tree.py:394 +#: iramuteq.py:336 msgid "Statistics" msgstr "Statistiques" -#: tree.py:405 +#: iramuteq.py:342 msgid "Sub corpus" msgstr "Sous-corpus" -#: tree.py:457 +#: tree.py:420 msgid "Sub corpus from clusters" msgstr "Sous-corpus par classe" -#: tree.py:403 +#: iramuteq.py:343 msgid "Sub corpus from metadata" msgstr "Sous-corpus par méta-données" -#: tree.py:404 +#: iramuteq.py:344 msgid "Sub corpus from thematic" msgstr "Sous-corpus par thématique" +#: dialog.py:3031 +msgid "Subcorpus" +msgstr "Sous-corpus" + #: dialog.py:1340 msgid "Supplementaries variables (almost 1)" msgstr "Variables supplémentaires (au moins 1)" @@ -1027,7 +1058,11 @@ msgstr "Prendre les x premiers points" msgid "Take the x first points by cluster" msgstr "Prendre les x premiers par classe" -#: iramuteq.py:301 +#: iramuteq.py:401 +msgid "Text" +msgstr "Texte" + +#: iramuteq.py:380 msgid "Text analysis" msgstr "Analyse de texte" @@ -1067,11 +1102,11 @@ msgstr "Taille du texte proportionnelle au chi2" msgid "Text size proportional to frequency" msgstr "Taille du texte proportionnelle à la fréquence" -#: tree.py:147 +#: tree.py:153 msgid "Textual corpus" msgstr "Corpus textuel" -#: tree.py:449 tree.py:478 +#: tree.py:412 tree.py:441 msgid "Tgen Editor" msgstr "Editeur de TGen" @@ -1083,7 +1118,7 @@ msgstr "Spécificités des TGens" msgid "This file already exists. Continue anyway ?" msgstr "Ce fichier existe déjà. Continuer quand même ?" -#: tree.py:1074 +#: tree.py:1037 #, python-format msgid "This file does not exist : %s" msgstr "Ce fichier n'existe pas : %s" @@ -1100,7 +1135,7 @@ msgstr "Ce n'est pas une méta-donnée" msgid "This is not a variable_modality form" msgstr "Ce n'est pas une forme du type variable_modalité" -#: iramuteq.py:241 +#: iramuteq.py:270 msgid "Tools" msgstr "Outils" @@ -1112,7 +1147,7 @@ msgstr "Outils du CNTRL (français uniquement)" msgid "Total" msgstr "Total" -#: listlex.py:209 listlex.py:274 ProfList.py:334 ProfList.py:611 +#: listlex.py:208 listlex.py:273 ProfList.py:334 ProfList.py:611 msgid "Typical text segments" msgstr "Segments de texte caractéristiques" @@ -1132,11 +1167,11 @@ msgstr "Utiliser le dictionnaire des expressions" msgid "Used forms" msgstr "Formes utilisées" -#: dialog.py:2874 +#: dialog.py:2873 msgid "Variables" msgstr "Variables" -#: dialog.py:2718 +#: dialog.py:2717 msgid "Variables (with the * but without the _)" msgstr "Variables (avec le * mais sans le _ )" @@ -1164,11 +1199,11 @@ msgstr "Taille des sommets proportionnelle à la fréquence" msgid "Vertex text size proportional to frequency" msgstr "Taille du texte des sommets proportionnelle à la fréquence" -#: iramuteq.py:299 +#: iramuteq.py:378 msgid "View" msgstr "Vue" -#: iramuteq.py:309 +#: iramuteq.py:388 msgid "Welcome" msgstr "Bienvenue" @@ -1184,7 +1219,7 @@ msgstr "Graphe du mot" msgid "Word size proportional to ..." msgstr "Taille des mots proportionnelles à ..." -#: iramuteq.py:290 tree.py:401 +#: iramuteq.py:341 msgid "WordCloud" msgstr "Nuage de mots" @@ -1208,16 +1243,15 @@ msgstr "actives et supplémentaires" msgid "actives forms" msgstr "formes actives" -#: tree.py:485 +#: tree.py:448 msgid "antiprofiles" msgstr "antiprofils" -#: dialog.py:3097 -#, fuzzy +#: dialog.py:3105 msgid "automatic" -msgstr "automatique (moyenne)" +msgstr "automatique" -#: dialog.py:2907 dialog.py:2927 +#: dialog.py:2906 dialog.py:2926 msgid "automatic (mean)" msgstr "automatique (moyenne)" @@ -1265,7 +1299,7 @@ msgstr "pourcentage en colonne" msgid "coordinates" msgstr "coordonnées" -#: dialog.py:2298 dialog.py:2697 +#: dialog.py:2298 dialog.py:2696 msgid "corpus" msgstr "corpus" @@ -1289,15 +1323,15 @@ msgstr "forme" msgid "frequency" msgstr "fréquences" -#: iramuteq.py:221 +#: iramuteq.py:250 msgid "from copy/paste" msgstr "à partir de copier/coller" -#: iramuteq.py:220 +#: iramuteq.py:249 msgid "from mail" msgstr "à partir de mails" -#: iramuteq.py:219 +#: iramuteq.py:248 msgid "from xml" msgstr "à partir de fichiers xml" @@ -1305,7 +1339,7 @@ msgstr "à partir de fichiers xml" msgid "graphical" msgstr "Graphique" -#: dialog.py:554 dialog.py:1826 dialog.py:1979 dialog.py:3113 guifunct.py:416 +#: dialog.py:554 dialog.py:1826 dialog.py:1979 dialog.py:3121 guifunct.py:416 msgid "height" msgstr "hauteur" @@ -1321,7 +1355,7 @@ msgstr "indexation" msgid "line classified on" msgstr "lignes classées sur" -#: dialog.py:2907 dialog.py:2927 dialog.py:3097 +#: dialog.py:2906 dialog.py:2926 dialog.py:3105 msgid "manual" msgstr "manuelle" @@ -1410,7 +1444,7 @@ msgstr "méthode pour svd" msgid "texts classified on" msgstr "textes classés sur" -#: dialog.py:2747 +#: dialog.py:2746 msgid "thematics (one by line, with the -*)" msgstr "thématiques (une par ligne, avec l'étoile (*))" @@ -1426,7 +1460,7 @@ msgstr "pourcentage total" msgid "variables" msgstr "variables" -#: dialog.py:552 dialog.py:1837 dialog.py:1991 dialog.py:3106 guifunct.py:423 +#: dialog.py:552 dialog.py:1837 dialog.py:1991 dialog.py:3114 guifunct.py:423 msgid "width" msgstr "largeur" @@ -1459,6 +1493,9 @@ msgstr "oui" #~ msgid "Similarities analysis" #~ msgstr "Analyses de similitudes" +#~ msgid "Split matrix" +#~ msgstr "Extraire de la matrice..." + #, fuzzy #~ msgid "Wordcloud" #~ msgstr "Nuage de mots" diff --git a/parse_europress.py b/parse_europress.py index 8097d30..5678aca 100644 --- a/parse_europress.py +++ b/parse_europress.py @@ -73,7 +73,7 @@ class MyHTMLParser(HTMLParser): #print "Encountered an end tag :", tag def handle_data(self, data): if self.currentattr == 'DocPublicationName' : - PublicationName = data.replace(' ', '_').replace('(','').replace(')','').replace('.','').replace('/','').replace("'",'').lower() + PublicationName = data.replace(' ', '_').replace('(','').replace(')','').replace('.','').replace('/','').replace("'",'').replace(';', '').replace(':', '').replace(u'·','').lower() PublicationName = PublicationName.split(',')[0] self.meta.append(u'*source_' + PublicationName) elif self.currentattr == 'DocHeader' : @@ -93,13 +93,14 @@ class MyHTMLParser(HTMLParser): self.outfile = outfile -class ParseEuropress : - def __init__(self, txtdir, fileout, encodage_in, encodage_out) : +def ParseEuropress(txtdir, fileout, encodage_in, encodage_out) : files = [] for root, subfolders, subfiles in os.walk(txtdir) : nf = [os.path.join(root, f) for f in subfiles if f.split('.')[-1] == 'html'] nf.sort() files += nf + if len(files) == 0 : + return 'nofile' tot = 0 parser = MyHTMLParser() with open(fileout,'w') as outf : @@ -110,7 +111,7 @@ class ParseEuropress : content = infile.read() parser.feed(content) tot += parser.nb - print 'ok', parser.nb, 'articles', ' - total : ', tot + return tot #ParseEuropress('/home/pierre/fac/lerass/mariage/press', '/home/pierre/workspace/iramuteq/dev/europress/corpus_out.txt', 'utf8', 'utf8') #print "Encountered some data :", data diff --git a/parse_factiva_xml.py b/parse_factiva_xml.py index 3defa0c..d43e9ae 100644 --- a/parse_factiva_xml.py +++ b/parse_factiva_xml.py @@ -14,9 +14,9 @@ from parse_factiva_mail import ParseFactivaMail from parse_factiva_txt import ParseFactivaPaste from parse_europress import ParseEuropress from import_txm import TXM2IRA +from functions import BugReport def ParseDocument(filename) : - print filename with codecs.open(filename, 'r', 'utf-8') as f : content = f.read() content = content.replace('', ' ').replace('', ' ') @@ -86,6 +86,8 @@ class PrefImport(wx.Dialog): self.PostCreate(pre) if methode in ['xml', 'txm'] : txt = _(u'Select a directory of xml files').decode('utf8') + elif methode == 'euro' : + txt = _(u'Select a directory of html files').decode('utf8') else : txt = _(u'Select a directory of txt files').decode('utf8') self.parent = parent @@ -153,8 +155,6 @@ class PrefImport(wx.Dialog): else : self.EndModal(wx.ID_CANCEL) - - class ImportFactiva(): def __init__(self, parent, methode): self.dial = PrefImport(parent, methode=methode) @@ -163,20 +163,40 @@ class ImportFactiva(): if val == wx.ID_OK : xmldir = self.dial.dbb.GetValue() corp_out = self.dial.fbb.GetValue() - if methode == 'xml' : - res = getcorpus_from_xml(xmldir, corp_out) - elif methode == 'mail' : - res = ParseFactivaMail(xmldir, corp_out, 'utf8', parent.syscoding) - elif methode == 'txt' : - res = ParseFactivaPaste(xmldir, corp_out, 'utf8', parent.syscoding) - elif methode == 'txm' : - res = TXM2IRA(xmldir, corp_out, 'utf8', parent.syscoding) - elif methode == 'euro' : - res = ParseEuropress(xmldir, corp_out, 'utf8', 'utf8') - if res == 'nofile' : - dlg = wx.MessageDialog(parent, u"Pas de fichier \'.xml\' dans %s" % xmldir, 'ATTENTION', wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING) - dlg.CenterOnParent() - dlg.ShowModal() - #else : - # parent.filename = corp_out - # parent.OpenText() + self.dial.Destroy() + busy = wx.BusyInfo(_("Please wait...").decode('utf8')) + wx.SafeYield() + try : + if methode == 'xml' : + res = getcorpus_from_xml(xmldir, corp_out) + elif methode == 'mail' : + res = ParseFactivaMail(xmldir, corp_out, 'utf8', parent.syscoding) + elif methode == 'txt' : + res = ParseFactivaPaste(xmldir, corp_out, 'utf8', parent.syscoding) + elif methode == 'txm' : + res = TXM2IRA(xmldir, corp_out, 'utf8', parent.syscoding) + elif methode == 'euro' : + res = ParseEuropress(xmldir, corp_out, 'utf8', 'utf8') + del busy + if res == 'nofile' : + dlg = wx.MessageDialog(parent, u"Pas de fichiers dans %s" % xmldir, 'ATTENTION', wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING) + dlg.CenterOnParent() + dlg.ShowModal() + dlg.Destroy() + else : + msg = '\n'.join([_(u"Corpus created :").decode('utf8'), corp_out, _(u"Do you want to open it in IRaMuTeQ ?").decode('utf8')]) + dlg = wx.MessageDialog(parent, msg, _(u'Information').decode('utf8'), wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION | wx.STAY_ON_TOP) + dlg.CenterOnParent() + val = dlg.ShowModal() + if val == wx.ID_YES : + dlg.Destroy() + parent.filename = os.path.abspath(corp_out) + parent.OpenText() + else : + dlg.Destroy() + except : + del busy + BugReport(parent) + else : + self.dial.Destroy() + diff --git a/tree.py b/tree.py index 5b4b616..f053fc1 100644 --- a/tree.py +++ b/tree.py @@ -392,8 +392,13 @@ class LeftTree(CT.CustomTreeCtrl): if not item in [self.textroot, self.matroot] : menu = wx.Menu() - info = menu.Append(wx.ID_ANY, _(u"Informations").decode('utf8')) - rename = menu.Append(wx.ID_ANY, _(u"Rename").decode('utf8')) + info = wx.MenuItem(menu, wx.ID_ANY, _(u"Informations").decode('utf8')) + info.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_INFORMATION)) + menu.AppendItem(info) + + rename = wx.MenuItem(menu, wx.ID_ANY, _(u"Rename").decode('utf8')) + rename.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_TIP)) + menu.AppendItem(rename) menu.AppendSeparator() if 'corpus_name' in pydata : @@ -451,8 +456,9 @@ class LeftTree(CT.CustomTreeCtrl): self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro) self.Bind(wx.EVT_MENU, self.OnRapport, rapport) - - itemdelete = menu.Append(wx.ID_ANY, _(u"Delete from history").decode('utf8')) + itemdelete = wx.MenuItem(menu, wx.ID_ANY, _(u"Delete from history").decode('utf8')) + itemdelete.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_DELETE)) + menu.AppendItem(itemdelete) #item11 = menu.Append(wx.ID_ANY, "Prepend An Item") #item12 = menu.Append(wx.ID_ANY, "Append An Item")