X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=iracmd.py;h=dd883f8dbb7f16e126c24a91afc3031885cc68c5;hp=8c000cb164d0c63b7407a4d6b1545adec33e3d7b;hb=c1ef58be7c81fc8f7b6dbc35c306cce25857ec2d;hpb=42a67a41b64a6e0cc3fd2a63a0749e9aa4b9374c diff --git a/iracmd.py b/iracmd.py index 8c000cb..dd883f8 100644 --- a/iracmd.py +++ b/iracmd.py @@ -18,7 +18,7 @@ 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)