X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=iracmd.py;h=dd883f8dbb7f16e126c24a91afc3031885cc68c5;hp=cec02e9fe82fbc9835c4999e7d9cb5d63fb45805;hb=2ffa9388c45dce689bb45c1cf6c7ad81d2636409;hpb=d1d24d86422c9e9805516190ea17a379201f9300 diff --git a/iracmd.py b/iracmd.py index cec02e9..dd883f8 100644 --- 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)