commited all contents created by participants

This commit is contained in:
Bachir Soussi Chiadmi
2017-12-21 18:12:40 +01:00
parent cefd1c2ad0
commit b936b1e616
2137 changed files with 1076319 additions and 730 deletions
Binary file not shown.
@@ -0,0 +1,36 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def obtenir ( option, fallback=False ) :
'''String -> String/Boolean
Si l'option demandée n'existe pas, renvoie False.
Si l'option demandée existe'''
# si on a l'option
if option in sys.argv:
index = sys.argv.index( option ) + 1
# si on a quelque chose après notre option
if len( sys.argv ) > index :
# si ce quelque chose ne commence pas par -
if sys.argv[ index ][0] != '-':
return sys.argv[ index ]
# si c'est le cas on a à priori une option booléenne
else:
# si pas de fallback
if not fallback:
return True
# sinon on retourne le fallback
else:
return fallback
# si on a l'option mais rien derrière
else:
# si pas de fallback
if not fallback:
return True
# si fallback
else:
# on renvoie le fallback
return fallback
# dans les autres cas on renvoie False ou le fallback si défini
return fallback
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def demarrer_graphe ( horizontal=False) :
print 'digraph G {'
if ( horizontal ):
print ' graph [ rankdir=LR ];'
def ajouter_noeud_mot ( word, id=False, label=False ):
print ' '
def lier( id_a, id_b ):
print ' '
def clore_graphe () :
print '}'
Binary file not shown.
@@ -0,0 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
'''
Ce module facilite l'import/export de fichiers
'''
def importer ( chemin ) :
'''String -> File
tente d'importer le fichier dont le chemin est spécifié'''
try:
fichier = open( chemin, 'r' )
return fichier
except Exception as erreur:
print erreur
return False
def exporter ( contenu, chemin=False ):
''''''
if ( chemin == False ):
chemin = generer_nom_de_fichier()
fichier = open( chemin, 'w' )
if ( isinstance( contenu, basestring) ):
fichier.write( contenu )
elif ( isinstance( contenu, (list, tuple) ) ):
traiter_liste ( contenu, fichier )
fichier.close()
def generer_nom_de_fichier ():
''''''
return datetime.datetime.now().strftime("%Y-%m-%d-%Hh%Mm%Ss.txt")
def traiter_liste ( liste, fichier ):
''''''
for item in liste:
if ( isinstance( item, basestring) ):
fichier.write( item )
elif isinstance( item, (list, tuple)):
traiter_liste ( item, fichier )
Binary file not shown.
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
posse = {
"CC" : u"conjonction de coordination",
"CD" : u"nombre cardinal",
"DT" : u"déterminant",
"EX" : u"Existential there",
"FW" : u"mot étranger",
"IN" : u"préposition ou conjonction de subordination",
"JJ" : u"adjectif",
"JJR" : u"adjectif comparatif",
"JJS" : u"adjectif superlatif",
"LS" : u"marqueur d'élément de liste",
"MD" : u"modal",
"NN" : u"nm, singulier ou mass",
"NNS" : u"nom, pluriel",
"NNP" : u"nom propre, singulier",
"NNPS" : u"nom propre, pluriel",
"PDT" : u"predeterminer",
"POS" : u"possessive ending",
"PRP" : u"pronom personnel",
"PRP$" : u"pronom possessif",
"RB" : u"adverbe",
"RBR" : u"adverbe, comparatif",
"RBS" : u"adverbe, superlatif",
"RP" : u"particle",
"SYM" : u"symbole",
}
def importer :
return posse