commited all contents created by participants
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
prefixe1 = "MONO-"
|
||||
prefixe2 = "UNI-"
|
||||
prefixe3 = "ANTI-"
|
||||
prefixe4 = "SUB-"
|
||||
|
||||
#prefixes = prefixe1+ prefixe2+ prefixe3+ prefixe4 : chaîne de caractère / phrase
|
||||
#print ( type(nom_du_variable)) :pour savoir quel type d'objet
|
||||
prefixes = [prefixe1, prefixe2, prefixe3, prefixe4]
|
||||
print (prefixes)
|
||||
|
||||
#print (prefixe1)
|
||||
|
||||
#intégrer une sentence
|
||||
#myfile = open ("which_spites.txt", 'r')
|
||||
#sentence = myfile.read()
|
||||
#myfile.close()
|
||||
|
||||
phrase = "And that which spites me more than all these wants- He does it under name of perfect love"
|
||||
#print("1ere réplique:", phrase)
|
||||
|
||||
#définir la liste de mot correspondante
|
||||
nouvelle_phrase = []
|
||||
|
||||
mots = phrase.split()
|
||||
#print(mots)
|
||||
for mot in mots:
|
||||
nouveau_mot= prefixe1+mot
|
||||
#print(nouveau_mot)
|
||||
nouvelle_phrase.append(nouveau_mot)
|
||||
|
||||
#print(nouvelle_phrase)
|
||||
|
||||
#print("phrase mono-", " ".join(nouvelle_phrase))
|
||||
|
||||
|
||||
|
||||
#séparer chaque mot
|
||||
|
||||
|
||||
|
||||
#choix d'un prefixe parmis le stack de prefixe
|
||||
|
||||
#indiquer au prefixe qu'il precede le mot
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
import random
|
||||
|
||||
prefixe1 = "MONO-"
|
||||
prefixe2 = "UNI-"
|
||||
prefixe3 = "ANTI-"
|
||||
prefixe4 = "SUB-"
|
||||
|
||||
#prefixes = prefixe1+ prefixe2+ prefixe3+ prefixe4 : chaîne de caractère / phrase
|
||||
#print ( type(nom_du_variable)) :pour savoir quel type d'objet
|
||||
prefixes = [prefixe1, prefixe2, prefixe3, prefixe4]
|
||||
print (prefixes)
|
||||
|
||||
#print (prefixe1)
|
||||
#intégrer une sentence
|
||||
#myfile = open ("which_spites.txt", 'r')
|
||||
#sentence = myfile.read()
|
||||
#myfile.close()
|
||||
|
||||
phrase = "And that which spites me more than all these wants- He does it under name of perfect love"
|
||||
print("1ere réplique:", phrase)
|
||||
|
||||
#définir la liste de mot correspondante
|
||||
nouvelle_phrase = []
|
||||
|
||||
mots = phrase.split()
|
||||
print(mots)
|
||||
for mot in mots:
|
||||
prefixe =random.choice(prefixes)
|
||||
print("prefixe aléatoire:", prefixe)
|
||||
|
||||
nouveau_mot= prefixe+mot
|
||||
print(nouveau_mot)
|
||||
nouvelle_phrase.append(nouveau_mot)
|
||||
|
||||
print(nouvelle_phrase)
|
||||
|
||||
print("phrase mono-", " ".join(nouvelle_phrase))
|
||||
|
||||
|
||||
|
||||
#séparer chaque mot
|
||||
|
||||
|
||||
|
||||
#choix d'un prefixe parmis le stack de prefixe
|
||||
|
||||
#indiquer au prefixe qu'il precede le mot
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
import random
|
||||
|
||||
#prefixes = prefixe1+ prefixe2+ prefixe3+ prefixe4 : chaîne de caractère / phrase
|
||||
#print ( type(nom_du_variable)) :pour savoir quel type d'objet
|
||||
prefixes = [
|
||||
"mono",
|
||||
"uni",
|
||||
"anti",
|
||||
"sub",
|
||||
"cyber",
|
||||
"para",
|
||||
"auto",
|
||||
"post",
|
||||
"inter",
|
||||
"homo"
|
||||
]
|
||||
print (prefixes)
|
||||
#jusque là c'est bon
|
||||
|
||||
#print (prefixe1)
|
||||
#intégrer une sentence
|
||||
#myfile = open ("which_spites.txt", 'r')
|
||||
#sentence = myfile.read()
|
||||
#myfile.close()
|
||||
|
||||
phrase = "Thus have I politicly begun my reign, And 'tis my hope to end successfully.\
|
||||
My falcon now is sharp and passing empty. And till she stoop she must not be full-gorg'd, for then she never looks upon her lure. Another way I have to man my haggard, to make her come, and know her keeper's call, that is, to watch her, as we watch these kites that bate and beat, and will not be obedient. She eat no meat to-day, nor none shall eat; last night she slept not, nor to-night she shall not; as with the meat, some undeserved fault I'll find about the making of the bed; and here I'll fling the pillow, there the bolster, this way the coverlet, another way the sheets; Ay, and amid this hurly I intend that all is done in reverend care of her and, in conclusion, she shall watch all night; and if she chance to nod I'll rail and brawl and with the clamour keep her still awake. This is a way to kill a wife with kindness, and thus I'll curb her mad and headstrong humour. He that knows better how to tame a shrew, now let him speak; 'tis charity to show."
|
||||
print("1ere réplique:", phrase)
|
||||
nouvelle_phrase = []
|
||||
sortie = ''
|
||||
lettres_seules = []
|
||||
longueur_mini = 5
|
||||
|
||||
mots = phrase.split()
|
||||
print("réplique séparé:",mots)
|
||||
|
||||
for mot in mots:
|
||||
# si le mot est assez long
|
||||
if ( len(mot) >= longueur_mini ) :
|
||||
print('mot à préfixer : ' + mot)
|
||||
nouvelle_phrase.append( random.choice( prefixes ) + mot )
|
||||
else:
|
||||
nouvelle_phrase.append( mot )
|
||||
|
||||
# lettres_seules = list(mot)
|
||||
# print("tentative de lettre:", lettres_seules)
|
||||
# print (len(mot))
|
||||
# length = len(mot)
|
||||
# if length >= 4 :
|
||||
print(nouvelle_phrase)
|
||||
print('---')
|
||||
for mot in nouvelle_phrase:
|
||||
sortie = sortie + mot + ' '
|
||||
|
||||
print(sortie)
|
||||
|
||||
#for mot in mots:
|
||||
#length >= 4= list (mot)
|
||||
|
||||
|
||||
# mots_length4= length >= 4= list (mot)
|
||||
# print ("listes mots choisis:", mots_length4)
|
||||
#
|
||||
# nouveau_mot= prefixe+mot
|
||||
# print(nouveau_mot)
|
||||
# nouvelle_phrase.append(nouveau_mot)
|
||||
|
||||
#len(mot) : "combien de lettres compose chaque mot?"
|
||||
#length = len(mot) : "LA LONGUEUR DU MOT"
|
||||
#if length >= 4 : "si mon mot est plus grand que 4..."
|
||||
#print (length, mot) "... me le montrer" : rajouter un script dans le script pour l'ensemble des actions; trouver, déinir, classer...
|
||||
|
||||
|
||||
#définir la liste de mot correspondante:
|
||||
#c'est devenu les mots de plus de ' lettres'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#print(nouvelle_phrase)
|
||||
|
||||
#print("phrase mono-", " ".join(nouvelle_phrase))
|
||||
|
||||
|
||||
|
||||
#séparer chaque mot
|
||||
|
||||
|
||||
|
||||
#choix d'un prefixe parmis le stack de prefixe
|
||||
|
||||
#indiquer au prefixe qu'il precede le mot
|
||||
|
||||
#pour export
|
||||
with open('export.txt','w')as f:
|
||||
f.write(dictee_genetic)
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
import random
|
||||
|
||||
#prefixes = prefixe1+ prefixe2+ prefixe3+ prefixe4 : chaîne de caractère / phrase
|
||||
#print ( type(nom_du_variable)) :pour savoir quel type d'objet
|
||||
prefixes = [
|
||||
"mono",
|
||||
"uni",
|
||||
"anti",
|
||||
"sub",
|
||||
"cyber",
|
||||
"para",
|
||||
"auto",
|
||||
"post",
|
||||
"inter",
|
||||
"homo"
|
||||
]
|
||||
print (prefixes)
|
||||
#jusque là c'est bon
|
||||
|
||||
#print (prefixe1)
|
||||
#intégrer une sentence
|
||||
#myfile = open ("which_spites.txt", 'r')
|
||||
#sentence = myfile.read()
|
||||
#myfile.close()
|
||||
|
||||
phrase = "Ainsi, j’ai commencé mon règne en habile politique, et j’ai l’espoir d’arriver heureusement à mon but. Mon faucon est animé, et fort affamé… ; et jusqu’à ce qu’il s’apprivoise, il ne faut pas trop le gorger de nourriture : car alors il ne daigne plus arrêter ses yeux sur le leurre. J’ai encore un autre moyen de façonner mon faucon sauvage, et de lui apprendre à revenir et à connaître la voix de son maître :\
|
||||
c’est de la veiller comme on veille sur ces milans qui voltigent, se révoltent et ne veulent pas obéir : elle n’a goûté de rien aujourd’hui, et elle ne goûtera encore de rien. La nuit dernière elle n’a pas dormi, elle ne dormira pas encore cette nuit : je saurai trouver quelque défaut imaginaire à la façon du lit, comme j’en ai trouvé au souper, et je ferai voler l’oreiller d’un côté, les draps de l’autre. — Oui, et au milieu de ce vacarme, je prétendrai que tout ce que j’en fais, c’est par égard pour elle ; pour conclusion, elle veillera toute la nuit ; et si elle vient à fermer les paupières, je crierai, je tempêterai et la tiendrai sans cesse éveillée par mes clameurs. Voilà le vrai secret de tuer une femme par trop de bonté, et comme cela, je viendrai à bout de dompter son humeur hautaine et intraitable. — Que celui qui saura un meilleur moyen pour mettre une méchante femme à la raison parle et m’apprenne sa recette. — C’est une charité que d’enseigner ce secret."
|
||||
print("1ere réplique:", phrase)
|
||||
nouvelle_phrase = []
|
||||
sortie = ''
|
||||
lettres_seules = []
|
||||
longueur_mini = 5
|
||||
|
||||
mots = phrase.split()
|
||||
print("réplique séparé:",mots)
|
||||
|
||||
for mot in mots:
|
||||
# si le mot est assez long
|
||||
if ( len(mot) >= longueur_mini ) :
|
||||
print('mot à préfixer : ' + mot)
|
||||
nouvelle_phrase.append( random.choice( prefixes ) + mot )
|
||||
else:
|
||||
nouvelle_phrase.append( mot )
|
||||
|
||||
# lettres_seules = list(mot)
|
||||
# print("tentative de lettre:", lettres_seules)
|
||||
# print (len(mot))
|
||||
# length = len(mot)
|
||||
# if length >= 4 :
|
||||
print(nouvelle_phrase)
|
||||
print('---')
|
||||
for mot in nouvelle_phrase:
|
||||
sortie = sortie + mot + ' '
|
||||
|
||||
print(sortie)
|
||||
|
||||
#for mot in mots:
|
||||
#length >= 4= list (mot)
|
||||
|
||||
|
||||
# mots_length4= length >= 4= list (mot)
|
||||
# print ("listes mots choisis:", mots_length4)
|
||||
#
|
||||
# nouveau_mot= prefixe+mot
|
||||
# print(nouveau_mot)
|
||||
# nouvelle_phrase.append(nouveau_mot)
|
||||
|
||||
#len(mot) : "combien de lettres compose chaque mot?"
|
||||
#length = len(mot) : "LA LONGUEUR DU MOT"
|
||||
#if length >= 4 : "si mon mot est plus grand que 4..."
|
||||
#print (length, mot) "... me le montrer" : rajouter un script dans le script pour l'ensemble des actions; trouver, déinir, classer...
|
||||
|
||||
|
||||
#définir la liste de mot correspondante:
|
||||
#c'est devenu les mots de plus de ' lettres'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#print(nouvelle_phrase)
|
||||
|
||||
#print("phrase mono-", " ".join(nouvelle_phrase))
|
||||
|
||||
|
||||
|
||||
#séparer chaque mot
|
||||
|
||||
|
||||
|
||||
#choix d'un prefixe parmis le stack de prefixe
|
||||
|
||||
#indiquer au prefixe qu'il precede le mot
|
||||
|
||||
#pour export
|
||||
#with open('export.txt','w')as f:
|
||||
#f.write(dictee_genetic)
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
import random
|
||||
|
||||
|
||||
#print (prefixe1)
|
||||
#intégrer une sentence
|
||||
#myfile = open ("which_spites.txt", 'r')
|
||||
#sentence = myfile.read()
|
||||
#myfile.close()
|
||||
|
||||
phrase = "And that which spites me more than all these wants- He does it under name of perfect love"
|
||||
print("1ere réplique:", phrase)
|
||||
|
||||
mots = sentence.split(" ")
|
||||
print( "liste des mots:", mots )
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
import random
|
||||
|
||||
|
||||
phrase = "And that which spites me more than all these wants- He does it under name of perfect love"
|
||||
print("1ere réplique:", phrase)
|
||||
#jusque là c'est bon
|
||||
|
||||
mots = phrase.split()
|
||||
print( "liste des mots:",mots )
|
||||
#jusque là c'est bon
|
||||
|
||||
|
||||
#FAUX: j'essaie de séparer chaques lettres d'un mot, d'épeler;
|
||||
#j'ai déjà des mots en liste; je doit leur dire que, un par un ils doivent
|
||||
#s'épeler
|
||||
|
||||
#Tentative 1#for lettre in mots:
|
||||
#lettres_seules = mots.split()
|
||||
#print("tentative de lettre", lettres_seules)
|
||||
|
||||
lettres_seules = []
|
||||
for mot in mots:
|
||||
lettres_seules = list(mot)
|
||||
print("tentative de lettre:", lettres_seules)
|
||||
print (len(mot))
|
||||
length = len(mot)
|
||||
if length >= 4 :
|
||||
print (length, mot)
|
||||
#len(mot) : "combien de lettres compose chaque mot?"
|
||||
#length = len(mot) : "LA LONGUEUR DU MOT"
|
||||
#if length >= 4 : "si mon mot est plus grand que 4..."
|
||||
#print (length, mot) "... me le montrer" : rajouter un script dans le script pour l'ensemble des actions; trouver, déinir, classer...
|
||||
#jusque là c'est bon
|
||||
|
||||
mots_length4= length >= 4,mot
|
||||
print ("listes mots choisis:", mots_length4)
|
||||
|
||||
#print("liste de lettre", lettre)
|
||||
@@ -0,0 +1,6 @@
|
||||
#déclarer les variables
|
||||
lettre1 = "o"
|
||||
lettre2 = "l"
|
||||
lettre3 = "a"
|
||||
print(lettre1+lettre2+lettre3)
|
||||
#print(lettre1,lettre2,lettre3)
|
||||
@@ -0,0 +1 @@
|
||||
And that which spites me more than all these wants- ␍He does it under name of perfect love
|
||||
Reference in New Issue
Block a user