lot of things :)
[iramuteq] / iracmd.py
index cec02e9..dd883f8 100644 (file)
--- a/iracmd.py
+++ b/iracmd.py
@@ -12,13 +12,13 @@ import locale
 import codecs
 sys.setdefaultencoding(locale.getpreferredencoding())
 from chemins import ConstructConfigPath, ConstructDicoPath, ConstructRscriptsPath
-from functions import ReadLexique, DoConf, History
+from functions import ReadLexique, DoConf, History, ReadDicoAsDico
 from ConfigParser import *
 #######################################
 #from textchdalc import AnalyseAlceste
 #from textdist import PamTxt
 #from textafcuci import AfcUci
-from analysetxt import Alceste,  gramact, gramsup
+from analysetxt import Alceste
 from corpus import Corpus, copycorpus
 from textaslexico import Lexico
 from textstat import Stat
@@ -46,7 +46,8 @@ else:
 UserConfigPath = os.path.abspath(os.path.join(user_home, '.iramuteq'))
 
 class CmdLine :
-    def __init__(self, args = None) :
+    def __init__(self, args = None, AppliPath = None) :
+        AppliPath = AppliPath
         self.DictPath = ConstructDicoPath(AppliPath)
         self.ConfigPath = ConstructConfigPath(UserConfigPath)
         self.syscoding = sys.getdefaultencoding()
@@ -94,10 +95,14 @@ class CmdLine :
         if options.filename or options.read :
             self.corpus_encodage = options.encodage
             self.corpus_lang = options.language
-                
+            self.keys = DoConf(self.ConfigPath['key']).getoptions()
 
             ReadLexique(self, lang = options.language)
             self.expressions = ReadDicoAsDico(self.DictPath.get(options.language + '_exp', 'french_exp'))
+            gramact = [k for k in self.keys if self.keys[k] == 1]
+            gramsup = [k for k in self.keys if self.keys[k] == 2]
+
             if options.filename :
                 self.filename = os.path.abspath(options.filename)
                 if options.corpusconfigfile is not None :
@@ -130,6 +135,11 @@ class CmdLine :
                 #corpus.conn_all()
                 corpus.make_lems()
                 corpus.parse_active(gramact, gramsup)
+                for forme in corpus.formes :
+                    if corpus.formes[forme].gram == '' or corpus.formes[forme].gram == ' ' :
+                        print forme
+                        for val in dir(corpus.formes[forme]) :
+                            print getattr(corpus.formes[forme], val)
                 #print corpus.getlemconcorde('de').fetchall()
 #            log.warning('ATTENTION gethapaxuces')
 #            MakeUciStat(corpus)
@@ -166,5 +176,5 @@ class CmdLine :
 
 if __name__ == '__main__':
     __name__ = 'Main'
-    CmdLine()
+    CmdLine(AppliPath = AppliPath)