commited all contents created by participants
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 357 KiB |
@@ -0,0 +1,14 @@
|
||||
---
|
||||
Author: Adrien Chacon
|
||||
Title: CNSNNZ SVP
|
||||
Src: sources/export.txt
|
||||
---
|
||||
|
||||
De l'injonction à consommer au plaisir de consonner : une lecture codée d'un article des Échos du 7/7/17 où le président de l'Alliance du commerce vante les mérites du travail dominical.
|
||||
"Cet accord est une excellente nouvelle pour nos enseignes, qui traversent des momnts diffcls dps plsrs anns."
|
||||
Script écrit le 17/12/17
|
||||
|
||||
Résultat :
|
||||
Ls 120 ensgns de l'hbllmnt trvnt un accrd pr ovrr le dmnch
|
||||
Le trvl du dmnch vnt de frnchr un pas de gnt. La Fdrtn des ensgns de l'hbllmnt vnt de sgnr avc les prtnrs scx du cmmrc sccrslst un accrd scl sur la drgtn au rps dmncl dns la cdr de la loi Mcrn s'pplqnt dns les zns trstqs intrntnls. Un cap dcsf car il s'gt du pls imprtnt accrd de brnch atrsnt le trvl le dmnch sgn à ce jr. Il cncrn en efft pls de 120 ensgns, cmm Kb, H&M, Cl ou Cm, st 22.000 pnts de vnt et prs de 120.000 slrs. Il a fll pls d'n an à la fdrtn et aux orgnstns sndcls pr trvr un trrn d'ntnt. Pr les slrs qui se prtrnt vlntrs, les prts ont vld le dblmnt de la rmnrtn des hrs effcts le dmnch. De pls, « le rps cmpnstr sr rmnr pr les hrs spplmntrs effcts ce jr-là ", indq la Fdrtn des ensgns de l'hbllmnt. Il sr pssbl pr cx qui le vlnt de rvnr sur lr dcsn et de bnfcr d'n dmnch qui n'tt pas prv, « en cas d'ndspnblt pnctll ". Un impct fvrbl sur l'mpl Le plfnd a été fx à 26 dmnchs trvlls par an, sf si le slr vt en fr pls. En échng, les ensgns se snt enggs à fnncr les frs de grd des enfnts, et ce à htr de 40 ers mxmm par dmnch trvll. « Cet accrd est une excllnt nvll pr nos ensgns, qui trvrsnt des mmnts dffcls dps plsrs anns. Les mgsns d'hbllmnt, à l'nstr des grnds mgsns, vnt enfn pvr bnfcr de la clntl dmncl », a indq Chrstn Pmnt, le prsdnt de l'Allnc du cmmrc. Ces ovrtrs dvrnt ass avr un impct fvrbl sur l'mpl. Les prtnrs scx estmnt que 850 psts srnt mntns grâc au chffr d'ffrs spplmntr attnd du dmnch et 250 empls nvx crs. Cet accrd de brnch est le qtrm sgn en Frnc dns le cmmrc cncrnnt le trvl dmncl, aprs le brclg (q dsps d'n drgtn de pln drt, la ctr prsnn et la bjtr-jllr).
|
||||
Les échs.fr du 7/7/17
|
||||
@@ -0,0 +1,15 @@
|
||||
h1. CNSNNZ SVP
|
||||
|
||||
h2. Adrien Chacon
|
||||
|
||||
Objectif : Plutôt que de consommer un texte, consonnons-le avec un script qui supprime les voyelles.
|
||||
Pour garder un minimum de lisibilité, on n'affecte que les mots de plus de 3 caractères et on laisse les voyelles en initiale.
|
||||
|
||||
!images/im-cnsnnz.jpg!
|
||||
|
||||
Ls 120 ensgns de l'hbllmnt trvnt un accrd pr ovrr le dmnch
|
||||
Le trvl du dmnch vnt de frnchr un pas de gnt. La Fdrtn des ensgns de l'hbllmnt vnt de sgnr avc les prtnrs scx du cmmrc sccrslst un accrd scl sur la drgtn au rps dmncl dns la cdr de la loi Mcrn s'pplqnt dns les zns trstqs intrntnls. Un cap dcsf car il s'gt du pls imprtnt accrd de brnch atrsnt le trvl le dmnch sgn à ce jr. Il cncrn en efft pls de 120 ensgns, cmm Kb, H&M, Cl ou Cm, st 22.000 pnts de vnt et prs de 120.000 slrs. Il a fll pls d'n an à la fdrtn et aux orgnstns sndcls pr trvr un trrn d'ntnt. Pr les slrs qui se prtrnt vlntrs, les prts ont vld le dblmnt de la rmnrtn des hrs effcts le dmnch. De pls, « le rps cmpnstr sr rmnr pr les hrs spplmntrs effcts ce jr-là ", indq la Fdrtn des ensgns de l'hbllmnt. Il sr pssbl pr cx qui le vlnt de rvnr sur lr dcsn et de bnfcr d'n dmnch qui n'tt pas prv, « en cas d'ndspnblt pnctll ". Un impct fvrbl sur l'mpl Le plfnd a été fx à 26 dmnchs trvlls par an, sf si le slr vt en fr pls. En échng, les ensgns se snt enggs à fnncr les frs de grd des enfnts, et ce à htr de 40 ers mxmm par dmnch trvll. « Cet accrd est une excllnt nvll pr nos ensgns, qui trvrsnt des mmnts dffcls dps plsrs anns. Les mgsns d'hbllmnt, à l'nstr des grnds mgsns, vnt enfn pvr bnfcr de la clntl dmncl », a indq Chrstn Pmnt, le prsdnt de l'Allnc du cmmrc. Ces ovrtrs dvrnt ass avr un impct fvrbl sur l'mpl. Les prtnrs scx estmnt que 850 psts srnt mntns grâc au chffr d'ffrs spplmntr attnd du dmnch et 250 empls nvx crs. Cet accrd de brnch est le qtrm sgn en Frnc dns le cmmrc cncrnnt le trvl dmncl, aprs le brclg (q dsps d'n drgtn de pln drt, la ctr prsnn et la bjtr-jllr).
|
||||
Les échs.fr du 7/7/17
|
||||
|
||||
script :
|
||||
!images/im-script.jpg!
|
||||
@@ -0,0 +1 @@
|
||||
ad ch,adch,mbp-de-ad-2,17.12.2017 17:01,file:///Users/adch/Library/Application%20Support/OpenOffice/4;
|
||||
@@ -0,0 +1 @@
|
||||
ad ch,adch,mbp-de-ad-2,17.12.2017 15:51,file:///Users/adch/Library/Application%20Support/OpenOffice/4;
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright (C) 2017 Constant, Algolit
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
'''
|
||||
Input texts are checked against a dictionary that assigns weights to different vowels.
|
||||
The script gives a score for a specific sentence.
|
||||
'''
|
||||
|
||||
# create a dictionary
|
||||
scrabble = {'a': 3, 'e': 1, 'i': 2, 'o': 4, 'u':4, 'y': 6}
|
||||
|
||||
# set weight to 0
|
||||
weights = 0
|
||||
|
||||
# find a sentence / string
|
||||
sentence = "La vie est un mystère qu'il faut vivre, et non un problème à résoudre."
|
||||
|
||||
# spllit sentence in list of words
|
||||
words = sentence.split()
|
||||
|
||||
# for each word
|
||||
for word in words:
|
||||
# iterate over letters of word
|
||||
for letter in word:
|
||||
# check if letter is in dictionary
|
||||
if letter in scrabble:
|
||||
# if yes, get weight of the letter
|
||||
weight = scrabble[letter]
|
||||
# add letter weight to general weight
|
||||
weights += weight
|
||||
|
||||
# print general weight
|
||||
print("Le poids de ma phrase est:", weights)
|
||||
+306
@@ -0,0 +1,306 @@
|
||||
i
|
||||
me
|
||||
my
|
||||
myself
|
||||
we
|
||||
our
|
||||
ours
|
||||
ourselves
|
||||
you
|
||||
your
|
||||
yours
|
||||
yourself
|
||||
yourselves
|
||||
he
|
||||
him
|
||||
his
|
||||
himself
|
||||
she
|
||||
her
|
||||
hers
|
||||
herself
|
||||
it
|
||||
its
|
||||
itself
|
||||
they
|
||||
them
|
||||
their
|
||||
theirs
|
||||
themselves
|
||||
what
|
||||
which
|
||||
who
|
||||
whom
|
||||
this
|
||||
that
|
||||
these
|
||||
those
|
||||
am
|
||||
is
|
||||
are
|
||||
was
|
||||
were
|
||||
be
|
||||
been
|
||||
being
|
||||
have
|
||||
has
|
||||
had
|
||||
having
|
||||
do
|
||||
does
|
||||
did
|
||||
doing
|
||||
a
|
||||
an
|
||||
the
|
||||
and
|
||||
but
|
||||
if
|
||||
or
|
||||
because
|
||||
as
|
||||
until
|
||||
while
|
||||
of
|
||||
at
|
||||
by
|
||||
for
|
||||
with
|
||||
about
|
||||
against
|
||||
between
|
||||
into
|
||||
through
|
||||
during
|
||||
before
|
||||
after
|
||||
above
|
||||
below
|
||||
to
|
||||
from
|
||||
up
|
||||
down
|
||||
in
|
||||
out
|
||||
on
|
||||
off
|
||||
over
|
||||
under
|
||||
again
|
||||
further
|
||||
then
|
||||
once
|
||||
here
|
||||
there
|
||||
when
|
||||
where
|
||||
why
|
||||
how
|
||||
all
|
||||
any
|
||||
both
|
||||
each
|
||||
few
|
||||
more
|
||||
most
|
||||
other
|
||||
some
|
||||
such
|
||||
no
|
||||
nor
|
||||
not
|
||||
only
|
||||
own
|
||||
same
|
||||
so
|
||||
than
|
||||
too
|
||||
very
|
||||
s
|
||||
t
|
||||
can
|
||||
will
|
||||
just
|
||||
don
|
||||
should
|
||||
now
|
||||
d
|
||||
ll
|
||||
m
|
||||
o
|
||||
re
|
||||
ve
|
||||
y
|
||||
ain
|
||||
aren
|
||||
couldn
|
||||
didn
|
||||
doesn
|
||||
hadn
|
||||
hasn
|
||||
haven
|
||||
isn
|
||||
ma
|
||||
mightn
|
||||
mustn
|
||||
needn
|
||||
shan
|
||||
shouldn
|
||||
wasn
|
||||
weren
|
||||
won
|
||||
wouldn
|
||||
Both
|
||||
Does
|
||||
Being
|
||||
Doesn
|
||||
Been
|
||||
Itself
|
||||
My
|
||||
M
|
||||
Then
|
||||
Up
|
||||
O
|
||||
Because
|
||||
Their
|
||||
Him
|
||||
Her
|
||||
Needn
|
||||
Until
|
||||
Has
|
||||
Other
|
||||
Have
|
||||
Ourselves
|
||||
Shouldn
|
||||
Than
|
||||
We
|
||||
His
|
||||
Herself
|
||||
By
|
||||
Which
|
||||
Those
|
||||
Again
|
||||
Yours
|
||||
Wasn
|
||||
After
|
||||
She
|
||||
Same
|
||||
Against
|
||||
More
|
||||
Into
|
||||
Theirs
|
||||
Don
|
||||
Your
|
||||
That
|
||||
Aren
|
||||
Now
|
||||
Themselves
|
||||
Will
|
||||
Why
|
||||
While
|
||||
Wouldn
|
||||
Under
|
||||
For
|
||||
Over
|
||||
Below
|
||||
Too
|
||||
Me
|
||||
Most
|
||||
Or
|
||||
Our
|
||||
And
|
||||
Are
|
||||
Them
|
||||
Whom
|
||||
Here
|
||||
Who
|
||||
Further
|
||||
But
|
||||
So
|
||||
Ain
|
||||
You
|
||||
Very
|
||||
Isn
|
||||
An
|
||||
Was
|
||||
In
|
||||
When
|
||||
Ours
|
||||
About
|
||||
Off
|
||||
Be
|
||||
Didn
|
||||
With
|
||||
These
|
||||
S
|
||||
Were
|
||||
How
|
||||
If
|
||||
Doing
|
||||
Each
|
||||
Hadn
|
||||
Where
|
||||
Can
|
||||
Only
|
||||
Down
|
||||
Ll
|
||||
This
|
||||
Couldn
|
||||
Himself
|
||||
To
|
||||
Yourself
|
||||
Its
|
||||
Above
|
||||
Out
|
||||
Ve
|
||||
He
|
||||
Not
|
||||
On
|
||||
It
|
||||
Myself
|
||||
A
|
||||
From
|
||||
Mustn
|
||||
I
|
||||
They
|
||||
Through
|
||||
What
|
||||
Do
|
||||
Re
|
||||
Haven
|
||||
No
|
||||
Before
|
||||
Of
|
||||
Just
|
||||
Shan
|
||||
At
|
||||
Own
|
||||
Did
|
||||
Is
|
||||
Between
|
||||
Some
|
||||
Few
|
||||
T
|
||||
Hers
|
||||
Won
|
||||
Y
|
||||
D
|
||||
The
|
||||
Weren
|
||||
Such
|
||||
Should
|
||||
Yourselves
|
||||
As
|
||||
Am
|
||||
Ma
|
||||
Having
|
||||
Once
|
||||
Mightn
|
||||
Had
|
||||
There
|
||||
All
|
||||
During
|
||||
Any
|
||||
Nor
|
||||
Hasn
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
|
||||
'''
|
||||
This script takes a sentence you write in the terminal, and gives it back in alphabetical order
|
||||
A list is ordered and changeable. It is less efficient than a set/tuple. But it allows to work with index numbers.
|
||||
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
|
||||
Made for OLA #5, Paris, 15-17 décembre 2017
|
||||
'''
|
||||
|
||||
# Ask to write a sentence
|
||||
sentence = "Les gouvernements suspectent la littérature parce qu’elle est une force qui leur échappe"
|
||||
# print sentence
|
||||
print("phrase originale:", sentence)
|
||||
|
||||
# Split sentence into words
|
||||
words = sentence.lower().split()
|
||||
print(words)
|
||||
|
||||
# sort words of list
|
||||
words.sort()
|
||||
print(words)
|
||||
|
||||
# print sorted wordlist as string
|
||||
#print("phrase dans l'ordre alphabétique:", "+".join(words).capitalize()+'.')
|
||||
@@ -0,0 +1,3 @@
|
||||
phrase originale: Les gouvernements suspectent la littérature parce qu’elle est une force qui leur échappe
|
||||
['les', 'gouvernements', 'suspectent', 'la', 'littérature', 'parce', 'qu’elle', 'est', 'une', 'force', 'qui', 'leur', 'échappe']
|
||||
['est', 'force', 'gouvernements', 'la', 'les', 'leur', 'littérature', 'parce', 'qui', 'qu’elle', 'suspectent', 'une', 'échappe']
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
|
||||
'''
|
||||
This script takes a sentence you write in the terminal, and gives it back in reverse mode
|
||||
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
|
||||
Made for OLA #5, Paris, 15-17 décembre 2017
|
||||
'''
|
||||
|
||||
# Run script in loop:
|
||||
while True:
|
||||
|
||||
# Ask to write a sentence
|
||||
sentence = input("Ecrivez votre phrase: ").lower().strip('\., \?')
|
||||
|
||||
# Split sentence into words
|
||||
words = sentence.split()
|
||||
#print(words)
|
||||
|
||||
# if sentence is only 1 word, reverse word
|
||||
if len(words) < 2:
|
||||
for word in words:
|
||||
word = word[::-1]
|
||||
print(word.capitalize())
|
||||
# if sentence is more than 1 word
|
||||
else:
|
||||
words.reverse()
|
||||
print(" ".join(words).capitalize(), '.')
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
'''
|
||||
Input texts are checked against occurences of certain words included in a list of "stopwords" established by NLTK (Natural Language Toolkit). These words are then removed.
|
||||
In data mining, text processing and machine learning, these so-called high frequency words are filtered out before or after natural language data is processed.
|
||||
Relational words such as 'the', 'is', 'at', 'which', and 'on' are considered redundant because they are too frequent, and meaningless once the word order is removed.
|
||||
'''
|
||||
|
||||
# A set is a list with unique words
|
||||
stopwords = set()
|
||||
|
||||
# define list of filtered words
|
||||
filtered_words = []
|
||||
|
||||
# read stopwords from file & save them in a list
|
||||
# read from file
|
||||
with open("english.txt", "r") as source:
|
||||
# for each line
|
||||
for line in source:
|
||||
# clean returns
|
||||
line = line.strip()
|
||||
# add word to set stopwords (cfr difference with list: list.append())
|
||||
stopwords.add(line)
|
||||
|
||||
# define your sentence / string
|
||||
sentence = 'I was at Synesthésie last night and took a bus to go home.'
|
||||
|
||||
# print sentence
|
||||
print("phrase originale:", sentence)
|
||||
|
||||
# convert string to list of words
|
||||
words = sentence.split(" ")
|
||||
# for each word of list, check if word is in stopwords, if it isn't, add word to filtered wordlist
|
||||
for word in words:
|
||||
if word not in stopwords:
|
||||
filtered_words.append(word)
|
||||
|
||||
# this is the same, but shorter + no need to declare filtered_words as list in the beginning:
|
||||
#filtered_words = [word for word in words if word not in stopwords]
|
||||
|
||||
|
||||
|
||||
# turn wordlist into string of characters
|
||||
new_sentence = " ".join(filtered_words)
|
||||
# print new sentence
|
||||
print("phrase réécrite:", new_sentence)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding=utf8
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# Reduction of letters
|
||||
# From string to list & back
|
||||
# A string: a list of characters, unchangeable, but treatable
|
||||
# See: https://www.tutorialspoint.com/python3/python_strings.htm
|
||||
|
||||
# Write sentence as string
|
||||
sentence = "Je vois La Vie en rose..."
|
||||
# Print sentence
|
||||
print("phrase originale:", sentence)
|
||||
|
||||
# define new word as list
|
||||
new_word = []
|
||||
|
||||
# Convert sentence in list of words
|
||||
words = sentence.split(" ")
|
||||
# For each word in word list
|
||||
for word in words:
|
||||
# remove capital letters (string operation)
|
||||
word = word.lower()
|
||||
# Clean punctuation (string operation)
|
||||
word = word.strip(" ;''?:,()!.\").”-")
|
||||
# add word to new word list
|
||||
new_word.append(word)
|
||||
|
||||
# Write words as one, without punctuation
|
||||
print("phrase mise en mots:", ''.join(new_word))
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
|
||||
'''
|
||||
This script takes a sentence you write in the terminal, and gives it back in reverse mode
|
||||
A list is ordered and changeable. It is less efficient than a set/tuple. But it allows to work with index numbers.
|
||||
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
|
||||
Made for OLA #5, Paris, 15-17 décembre 2017
|
||||
'''
|
||||
|
||||
# Run script in loop:
|
||||
while True:
|
||||
|
||||
# Ask to write a sentence
|
||||
sentence = input("Ecrivez votre phrase: ").lower().strip('\., \?')
|
||||
|
||||
# Split sentence into words
|
||||
words = sentence.split()
|
||||
#print(words)
|
||||
|
||||
# if sentence is only 1 word, reverse word
|
||||
if len(words) < 2:
|
||||
for word in words:
|
||||
word = word[::-1]
|
||||
print(word.capitalize())
|
||||
# if sentence is more than 1 word
|
||||
else:
|
||||
words.sort()
|
||||
print(" ".join(words).capitalize(), '.')
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
|
||||
'''
|
||||
This script takes a sentence you write in the terminal, and gives it back in alphabetical order
|
||||
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
|
||||
Made for OLA #5, Paris, 15-17 décembre 2017
|
||||
'''
|
||||
|
||||
# Run script in loop:
|
||||
while True:
|
||||
|
||||
# Ask to write a sentence
|
||||
sentence = input("Ecrivez votre phrase: ").lower().strip('\., \?')
|
||||
|
||||
# Split sentence into words
|
||||
words = sentence.split()
|
||||
#print(words)
|
||||
|
||||
# sort wordlist
|
||||
words.sort()
|
||||
print(" ".join(words).capitalize(), '.')
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
*.pyc
|
||||
*.egg-info
|
||||
build/
|
||||
dist/
|
||||
@@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1 @@
|
||||
include README.rst LICENSE
|
||||
@@ -0,0 +1,60 @@
|
||||
ANSI colors for Python
|
||||
======================
|
||||
|
||||
A simple module to add ANSI colors and decorations to your strings.
|
||||
|
||||
Install
|
||||
--------
|
||||
python set_up.py install
|
||||
|
||||
Example Usage
|
||||
-------------
|
||||
|
||||
You can choose one of the 8 basic ANSI colors: black, red, green, yellow, blue,
|
||||
magenta, cyan, white.
|
||||
|
||||
::
|
||||
|
||||
from colors import red, green, blue
|
||||
print red('This is red')
|
||||
print green('This is green')
|
||||
print blue('This is blue')
|
||||
|
||||
Optionally you can specify a background color.
|
||||
|
||||
::
|
||||
|
||||
print red('red on blue', bg='blue')
|
||||
print green('green on black', bg='black')
|
||||
|
||||
You can additionally specify one of the supported styles: bold, faint, italic,
|
||||
underline, blink, blink2, negative, concealed, crossed. Not all styles are
|
||||
supported by all terminals.
|
||||
|
||||
::
|
||||
|
||||
from colors import bold, underline
|
||||
print bold('This is bold')
|
||||
print underline('underline red on blue', fg='red', bg='blue')
|
||||
print green('bold green on black', bg='black', style='bold')
|
||||
|
||||
You can also use more than one styles at once.
|
||||
|
||||
::
|
||||
|
||||
print red('This is very important', style='bold+underline')
|
||||
|
||||
xterm-256 colors are supported as well, to use them give an integer instead of
|
||||
a color name.
|
||||
|
||||
::
|
||||
|
||||
from colors import color
|
||||
for i in range(256):
|
||||
print color('Color #%d' % i, fg=i)
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
colors is licensed under the ISC license.
|
||||
@@ -0,0 +1,85 @@
|
||||
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
|
||||
#
|
||||
# Permission to use, copy, modify, and distribute this software for any
|
||||
# purpose with or without fee is hereby granted, provided that the above
|
||||
# copyright notice and this permission notice appear in all copies.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
import re
|
||||
|
||||
from functools import partial
|
||||
|
||||
|
||||
__version__ = '1.0.2'
|
||||
|
||||
COLORS = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan',
|
||||
'white')
|
||||
STYLES = ('bold', 'faint', 'italic', 'underline', 'blink', 'blink2',
|
||||
'negative', 'concealed', 'crossed')
|
||||
|
||||
|
||||
def color(s, fg=None, bg=None, style=None):
|
||||
sgr = []
|
||||
|
||||
if fg:
|
||||
if fg in COLORS:
|
||||
sgr.append(str(30 + COLORS.index(fg)))
|
||||
elif isinstance(fg, int) and 0 <= fg <= 255:
|
||||
sgr.append('38;5;%d' % int(fg))
|
||||
else:
|
||||
raise Exception('Invalid color "%s"' % fg)
|
||||
|
||||
if bg:
|
||||
if bg in COLORS:
|
||||
sgr.append(str(40 + COLORS.index(bg)))
|
||||
elif isinstance(bg, int) and 0 <= bg <= 255:
|
||||
sgr.append('48;5;%d' % bg)
|
||||
else:
|
||||
raise Exception('Invalid color "%s"' % bg)
|
||||
|
||||
if style:
|
||||
for st in style.split('+'):
|
||||
if st in STYLES:
|
||||
sgr.append(str(1 + STYLES.index(st)))
|
||||
else:
|
||||
raise Exception('Invalid style "%s"' % st)
|
||||
|
||||
if sgr:
|
||||
prefix = '\x1b[' + ';'.join(sgr) + 'm'
|
||||
suffix = '\x1b[0m'
|
||||
return prefix + s + suffix
|
||||
else:
|
||||
return s
|
||||
|
||||
|
||||
def strip_color(s):
|
||||
return re.sub('\x1b\[.+?m', '', s)
|
||||
|
||||
|
||||
# Foreground shortcuts
|
||||
black = partial(color, fg='black')
|
||||
red = partial(color, fg='red')
|
||||
green = partial(color, fg='green')
|
||||
yellow = partial(color, fg='yellow')
|
||||
blue = partial(color, fg='blue')
|
||||
magenta = partial(color, fg='magenta')
|
||||
cyan = partial(color, fg='cyan')
|
||||
white = partial(color, fg='white')
|
||||
|
||||
# Style shortcuts
|
||||
bold = partial(color, style='bold')
|
||||
faint = partial(color, style='faint')
|
||||
italic = partial(color, style='italic')
|
||||
underline = partial(color, style='underline')
|
||||
blink = partial(color, style='blink')
|
||||
blink2 = partial(color, style='blink2')
|
||||
negative = partial(color, style='negative')
|
||||
concealed = partial(color, style='concealed')
|
||||
crossed = partial(color, style='crossed')
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
import colors
|
||||
|
||||
|
||||
setup(
|
||||
name='ansicolors',
|
||||
version=colors.__version__,
|
||||
description='ANSI colors for Python',
|
||||
long_description=open('README.rst').read(),
|
||||
author='Giorgos Verigakis',
|
||||
author_email='verigak@gmail.com',
|
||||
url='http://github.com/verigak/colors/',
|
||||
license='ISC',
|
||||
py_modules=['colors'],
|
||||
classifiers=[
|
||||
'Environment :: Console',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: ISC License (ISCL)',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3'
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from colors import color, COLORS, STYLES
|
||||
|
||||
|
||||
for bg in (None,) + COLORS:
|
||||
for fg in (None,) + COLORS:
|
||||
for style in (None,) + STYLES:
|
||||
text = ('%s' % (fg or 'normal')).ljust(7)
|
||||
print(color(text, fg=fg, bg=bg, style=style), end=' ')
|
||||
print()
|
||||
|
||||
for i in range(256):
|
||||
if i % 64 == 0:
|
||||
print()
|
||||
print(color(' ', bg=i), end='')
|
||||
|
||||
print()
|
||||
+3
File diff suppressed because one or more lines are too long
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env/ python
|
||||
|
||||
# This script rewrites the novel by replacing the name of the principal
|
||||
# character in the novel by another name.
|
||||
# It writes the new version of novel to a file called starring_me.txt and to a Logbook in Context
|
||||
# The idea for this script comes from the book 'Think Python'.
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit, An Mertens
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
import colors
|
||||
from colors import red, green, yellow, blue, magenta, cyan, bold, underline
|
||||
import time
|
||||
import os, sys
|
||||
|
||||
## FUNCTIONS
|
||||
# print on screen character per character
|
||||
def typewrite(sentence):
|
||||
words = sentence.split(" ")
|
||||
for word in words:
|
||||
for char in word:
|
||||
sys.stdout.write('%s' % char)
|
||||
sys.stdout.flush()
|
||||
time.sleep(0.1)
|
||||
sys.stdout.write(" ")
|
||||
sys.stdout.flush()
|
||||
|
||||
# write to file
|
||||
def archive(sentence):
|
||||
with open("novel_starring_you.txt", "a") as destination:
|
||||
destination.write(sentence)
|
||||
|
||||
# loop script
|
||||
while True:
|
||||
|
||||
# introduction, getting the variables
|
||||
print("\n\t\tDear visitor, we will rewrite the opening scene of ", green("Kurt Vonnegut's 2BRO2B"), " using your name and favourite city.\n")
|
||||
#time.sleep(2)
|
||||
first_name = input("\t\tPlease type your first name: ")
|
||||
#time.sleep(2)
|
||||
last_name = input("\n\t\tPlease type your last name: ")
|
||||
#time.sleep(2)
|
||||
country = input("\n\t\tChoose a country: ")
|
||||
#time.sleep(2)
|
||||
city = input("\n\t\tChoose a city in that country: ")
|
||||
#time.sleep(2)
|
||||
print("\n\t\tDo you want to be", green('female'), "or", green('male?'))
|
||||
gender = input("\t\tPlease type f or m: ")
|
||||
#time.sleep(5)
|
||||
print("\n")
|
||||
|
||||
# specify input text
|
||||
source = open("vonnegut.txt", "r")
|
||||
sentences =[]
|
||||
|
||||
# write & replace
|
||||
archive("\n\nNovel Starring You\n")
|
||||
archive("-------------\n\n")
|
||||
|
||||
with source as text:
|
||||
for line in text:
|
||||
line = line.replace("the United States", country)
|
||||
line = line.replace("Chicago", city)
|
||||
line = line.replace("Edward K.", first_name)
|
||||
line = line.replace("Wehling", last_name)
|
||||
if gender == 'f':
|
||||
line = line.replace(" man ", " woman ")
|
||||
line = line.replace(" man,", " woman,")
|
||||
line = line.replace(" his ", " her ")
|
||||
line = line.replace(" him ", " her ")
|
||||
line = line.replace(" His ", " Her ")
|
||||
line = line.replace(" wife ", " husband ")
|
||||
line = line.replace(" he ", " she ")
|
||||
line = line.replace(" He ", " She ")
|
||||
typewrite(line)
|
||||
archive(line)
|
||||
# break before relaunching the script
|
||||
time.sleep(10)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
Novel Starring You
|
||||
-------------
|
||||
|
||||
Everything was perfectly swell.
|
||||
|
||||
There were no prisons, no slums, no insane asylums, no cripples, no poverty, no wars.
|
||||
|
||||
All diseases were conquered. So was old age.
|
||||
|
||||
Death, barring accidents, was an adventure for volunteers.
|
||||
|
||||
|
||||
|
||||
Novel Starring You
|
||||
-------------
|
||||
|
||||
Everything was perfectly swell.
|
||||
|
||||
There were no prisons, no slums, no insane asylums, no cripples, no poverty, no wars.
|
||||
|
||||
All diseases were conquered. So was old age.
|
||||
|
||||
Death, barring accidents, was an adventure for volunteers.
|
||||
|
||||
The population of Belgiumm was stabilized at forty-million souls.
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
|
||||
'''
|
||||
This script looks at each word in a given text, if the word contains the letters of Perec, the word is printed to another textfile
|
||||
Made for OLA #5, Paris, 15-17 décembre 2017
|
||||
'''
|
||||
|
||||
# import external modules
|
||||
import re
|
||||
import string
|
||||
|
||||
# define textfiles
|
||||
source = open("../data/1984_all.txt", 'r')
|
||||
destination = open("../data/perec.txt", 'w')
|
||||
|
||||
# define regular expression
|
||||
regex = r'(\w*p+\w*e+\w*r+\w*e+\w*c+)'
|
||||
|
||||
|
||||
# write title to destination
|
||||
destination.write("Source: George Orwell's 1984\n\n\n")
|
||||
|
||||
# search for pattern in source, print in terminal & write to destination
|
||||
sentences = []
|
||||
# read source line by line
|
||||
for line in source:
|
||||
# split each line into list of words, split on white spaces
|
||||
words = line.split(" ")
|
||||
for word in words:
|
||||
# look if pattern is in word
|
||||
if re.search(regex, word):
|
||||
# if yes, print word in terminal
|
||||
print(word)
|
||||
# write word to file without punctuation
|
||||
destination.write(word.strip('\., \,')+'\n')
|
||||
|
||||
# close textfiles
|
||||
source.close()
|
||||
destination.close()
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env/ python
|
||||
# This script automatises the following Oulipo constraint:
|
||||
# http://oulipo.net/fr/contraintes/litterature-definitionnelle
|
||||
# The output is printed in a txt-file and in a Logbook in Context
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit, An Mertens
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import division
|
||||
import nltk
|
||||
from nltk.corpus import wordnet as wn
|
||||
from pattern.en import tag
|
||||
import nltk.data
|
||||
from random import shuffle, choice
|
||||
|
||||
|
||||
# VARIABLES
|
||||
|
||||
|
||||
# textfiles
|
||||
source = open("frankenstein_for_machines.txt", 'r')
|
||||
destination = open("litterature_definitionelle.txt", "wt")
|
||||
|
||||
|
||||
## SCRIPT
|
||||
|
||||
|
||||
# select 4 sentences from source
|
||||
## split source text into list of sentences
|
||||
finding_sentences = nltk.data.load('tokenizers/punkt/english.pickle')
|
||||
sentences_list = []
|
||||
with source as text:
|
||||
for line in text:
|
||||
# this returns a list with 1 element containing the entire text, sentences separated by \n
|
||||
sentences = '\n'.join(finding_sentences.tokenize(line.strip()))
|
||||
# transform string into list of sentences
|
||||
sentences_list = sentences.split("\n")
|
||||
|
||||
# pick 4 random sentences
|
||||
selected_sentences = []
|
||||
number = 0
|
||||
while number < 5:
|
||||
selected_sentences.append(choice(sentences_list))
|
||||
number += 1
|
||||
|
||||
|
||||
# tokenize source and get Part-of-Speech tags for each word
|
||||
definitions = []
|
||||
|
||||
for sentence in selected_sentences:
|
||||
# create tuple of tuples with pairs of word + POS-tag
|
||||
collection = tag(sentence, tokenize=True, encoding='utf-8')
|
||||
# transform tuple into list to be able to manipulate it
|
||||
collection = list(collection)
|
||||
# for each pair:
|
||||
for element in collection:
|
||||
# look for nouns & replace them with their definition
|
||||
if element[1] == "NN":
|
||||
if wn.synsets(element[0]):
|
||||
synset = wn.synsets(element[0])
|
||||
definitions.append("<")
|
||||
definitions.append(synset[0].definition())
|
||||
definitions.append(">")
|
||||
else:
|
||||
break
|
||||
else:
|
||||
# non-nouns are left as words
|
||||
definitions.append(element[0])
|
||||
|
||||
|
||||
# write the transformed sentence
|
||||
#print(" ".join(definitions))
|
||||
with destination as text:
|
||||
text.write("ORIGINAL TEXT\n\n\n")
|
||||
for sentence in selected_sentences:
|
||||
text.write(sentence+"\n")
|
||||
text.write("\n\n")
|
||||
text.write("\n\nLITTERATURE DEFINITIONELLE\n\n\n")
|
||||
text.write(" ".join(definitions))
|
||||
|
||||
|
||||
# close the text file
|
||||
source.close()
|
||||
destination.close()
|
||||
|
||||
# -------------------------------------------
|
||||
|
||||
# # Write in logbook
|
||||
|
||||
# # print chapters
|
||||
|
||||
# #writetologbook('\setuppagenumber[state=start]')
|
||||
# writetologbook('\n\section{LITTERATURE DEFINITIONELLE}\n')
|
||||
# # print_sentences(spring_chapter)
|
||||
# writetologbook('\nORIGINAL TEXT\crlf\crlf\n')
|
||||
# for sentence in selected_sentences:
|
||||
# writetologbook(sentence+"\n")
|
||||
# writetologbook("\crlf\crlf\n\n\n")
|
||||
# writetologbook('\nLITTERATURE DEFINITIONELLE\crlf\crlf\n')
|
||||
# writetologbook(" ".join(definitions))
|
||||
@@ -0,0 +1,195 @@
|
||||
#!/usr/bin/env/ python
|
||||
|
||||
# This script makes you choose 1 out of 2 Oulipo constraints:
|
||||
|
||||
# Constraint 1: http://oulipo.net/fr/contraintes/litterature-definitionnelle
|
||||
# Constraint 2: rewrites the beginning of a novel by replacing the principal names/places/gender
|
||||
# The idea for this script comes from the book 'Think Python'.
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit, An Mertens
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import division
|
||||
import nltk
|
||||
from nltk.corpus import wordnet as wn
|
||||
from pattern.en import tag
|
||||
import nltk.data
|
||||
from random import shuffle, choice, randrange
|
||||
|
||||
import colors
|
||||
from colors import red, green, yellow, blue, magenta, cyan, bold, underline
|
||||
import time
|
||||
import os, sys
|
||||
|
||||
|
||||
## FUNCTIONS
|
||||
# print on screen character per character
|
||||
def typewrite(sentence):
|
||||
words = sentence.split(" ")
|
||||
for word in words:
|
||||
for char in word:
|
||||
if char != "<" and char != ">":
|
||||
sys.stdout.write('%s' % char)
|
||||
sys.stdout.flush()
|
||||
time.sleep(0.1)
|
||||
sys.stdout.write(" ")
|
||||
sys.stdout.flush()
|
||||
|
||||
# loop script
|
||||
while True:
|
||||
|
||||
print "\n\t\tDear visitor, you can choose between", red(" two Oulipo applications.\n")
|
||||
#source = open("frankenstein_for_machines.txt", 'r')
|
||||
print "\t\tOption a is ", green("Litterature Definitionnelle"), " with sentences from Mary Shelley's Frankenstein.\n"
|
||||
#source = open("frankenstein_for_machines.txt", 'r')
|
||||
print "\t\tOption b is ", green("A Novel Starring You.\n")
|
||||
#source = open("frankenstein_for_machines.txt", 'r')
|
||||
print "\t\tType ", green('a'), " if you want to play with Litterature Definitionnelle.\n"
|
||||
#source = open("frankenstein_for_machines.txt", 'r')
|
||||
print "\t\tType ", green('b'), " if you want to be a star in the opening scene of Kurt Vonneguts' 2BRO2B.\n"
|
||||
#source = open("frankenstein_for_machines.txt", 'r')
|
||||
choice = raw_input("\t\tYour choice is: ")
|
||||
#source = open("frankenstein_for_machines.txt", 'r')
|
||||
print "\n"
|
||||
|
||||
os.system('cls' if os.name == 'nt' else 'clear')
|
||||
print "\n"
|
||||
|
||||
|
||||
### MEET ---------------------------------------------------------------------------------------------
|
||||
### --------------------------------------------------------------------------------------------------
|
||||
|
||||
### MEET/INTRO ---------------------------------------------------------------------------------------------
|
||||
|
||||
# retrain model
|
||||
if choice == 'a':
|
||||
|
||||
### Litterature definitionnelle
|
||||
|
||||
# textfiles
|
||||
source = open("frankenstein_for_machines.txt", 'r')
|
||||
#source = open("1984_fragment.txt", 'r')
|
||||
destination = open("litterature_definitionelle.txt", "wt")
|
||||
|
||||
|
||||
## SCRIPT
|
||||
|
||||
|
||||
# select 4 sentences from source
|
||||
## split source text into list of sentences
|
||||
finding_sentences = nltk.data.load('tokenizers/punkt/english.pickle')
|
||||
sentences_list = []
|
||||
with source as text:
|
||||
for line in text:
|
||||
# this returns a list with 1 element containing the entire text, sentences separated by \n
|
||||
sentences = '\n'.join(finding_sentences.tokenize(line.strip()))
|
||||
# transform string into list of sentences
|
||||
sentences_list = sentences.split("\n")
|
||||
|
||||
selected_sentences = [sentences_list[randrange(len(sentences_list))]
|
||||
for s in range(4)]
|
||||
|
||||
|
||||
|
||||
# tokenize source and get Part-of-Speech tags for each word
|
||||
definitions = []
|
||||
|
||||
for sentence in selected_sentences:
|
||||
# create tuple of tuples with pairs of word + POS-tag
|
||||
collection = tag(sentence, tokenize=True, encoding='utf-8')
|
||||
# transform tuple into list to be able to manipulate it
|
||||
collection = list(collection)
|
||||
# for each pair:
|
||||
for element in collection:
|
||||
# look for nouns & replace them with their definition
|
||||
if element[1] == "NN":
|
||||
if wn.synsets(element[0]):
|
||||
synset = wn.synsets(element[0])
|
||||
definitions.append("<")
|
||||
definitions.append(synset[0].definition())
|
||||
definitions.append(">")
|
||||
else:
|
||||
break
|
||||
else:
|
||||
# non-nouns are left as words
|
||||
definitions.append(element[0])
|
||||
|
||||
|
||||
# write the transformed sentence
|
||||
#print " ".join(definitions)
|
||||
for d in definitions:
|
||||
typewrite(d)
|
||||
|
||||
raw_input("\nPress Enter to continue...")
|
||||
# time.sleep(10)
|
||||
|
||||
# -------------------------------------------
|
||||
|
||||
elif choice == 'b':
|
||||
|
||||
### A Novel Starring You
|
||||
|
||||
# introduction, getting the variables
|
||||
print "\n\t\tDear visitor, we will rewrite the opening scene of ", green("Kurt Vonnegut's 2BRO2B"), " using your name and favourite city.\n"
|
||||
##source = open("frankenstein_for_machines.txt", 'r')
|
||||
first_name = raw_input("\t\tPlease type your first name: ")
|
||||
##source = open("frankenstein_for_machines.txt", 'r')
|
||||
last_name = raw_input("\n\t\tPlease type your last name: ")
|
||||
##source = open("frankenstein_for_machines.txt", 'r')
|
||||
country = raw_input("\n\t\tChoose a country: ")
|
||||
##source = open("frankenstein_for_machines.txt", 'r')
|
||||
city = raw_input("\n\t\tChoose a city in that country: ")
|
||||
##source = open("frankenstein_for_machines.txt", 'r')
|
||||
print "\n\t\tDo you want to be", green('female'), "or", green('male?')
|
||||
gender = raw_input("\t\tPlease type f or m: ")
|
||||
#time.sleep(5)
|
||||
print "\n"
|
||||
|
||||
# specify input text
|
||||
source = open("vonnegut.txt", "r")
|
||||
sentences =[]
|
||||
|
||||
# write & replace
|
||||
archive("\n\nNovel Starring You\n")
|
||||
archive("-------------\n\n")
|
||||
|
||||
with source as text:
|
||||
for line in text:
|
||||
line = line.replace("the United States", country)
|
||||
line = line.replace("Chicago", city)
|
||||
line = line.replace("Edward K.", first_name)
|
||||
line = line.replace("Wehling", last_name)
|
||||
if gender == 'f':
|
||||
line = line.replace(" man ", " woman ")
|
||||
line = line.replace(" man,", " woman,")
|
||||
line = line.replace(" his ", " her ")
|
||||
line = line.replace(" him ", " her ")
|
||||
line = line.replace(" His ", " Her ")
|
||||
line = line.replace(" wife ", " husband ")
|
||||
line = line.replace(" he ", " she ")
|
||||
line = line.replace(" He ", " She ")
|
||||
typewrite(line)
|
||||
archive(line)
|
||||
# break before relaunching the script
|
||||
raw_input("\nPress Enter to continue...")
|
||||
time.sleep(10)
|
||||
|
||||
### ELSE --------------------------------------------------------------------------------------
|
||||
### -------------------------------------------------------------------------------------------
|
||||
|
||||
# try again
|
||||
else:
|
||||
print "\t\tYou must have typed something else."
|
||||
#time.sleep(30)
|
||||
raw_input("\nPress Enter to continue...")
|
||||
os.system('cls' if os.name == 'nt' else 'clear')
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/python
|
||||
# this is a shebang: https://en.wikipedia.org/wiki/Shebang_%28Unix%29
|
||||
|
||||
'''
|
||||
This script takes a sentence you write in the terminal, and gives it back in reverse mode
|
||||
Check out other options for list comprehension: https://docs.python.org/3/tutorial/datastructures.html
|
||||
Made for OLA #5, Paris, 15-17 décembre 2017
|
||||
'''
|
||||
|
||||
# Run script in loop:
|
||||
while True:
|
||||
|
||||
# Ask to write a sentence
|
||||
sentence = input("Ecrivez votre phrase: ").lower().strip('\., \?')
|
||||
|
||||
# Split sentence into words
|
||||
words = sentence.split()
|
||||
#print(words)
|
||||
|
||||
# if sentence is only 1 word, reverse word
|
||||
if len(words) < 2:
|
||||
for word in words:
|
||||
word = word[::-1]
|
||||
print(word.capitalize())
|
||||
# if sentence is more than 1 word
|
||||
else:
|
||||
words.reverse()
|
||||
print(" ".join(words).capitalize(), '.')
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
Everything was perfectly swell.
|
||||
|
||||
There were no prisons, no slums, no insane asylums, no cripples, no poverty, no wars.
|
||||
|
||||
All diseases were conquered. So was old age.
|
||||
|
||||
Death, barring accidents, was an adventure for volunteers.
|
||||
|
||||
The population of the United States was stabilized at forty-million souls.
|
||||
|
||||
One bright morning in the Chicago Lying-in Hospital, a man named Edward K. Wehling, Jr., waited for his wife to give birth. He was the only man waiting. Not many people were born a day any more.
|
||||
|
||||
Wehling was fifty-six, a mere stripling in a population whose average age was one hundred and twenty-nine.
|
||||
|
||||
X-rays had revealed that his wife was going to have triplets. The children would be his first.
|
||||
|
||||
Young Wehling was hunched in his chair, his head in his hand. He was so rumpled, so still and colorless as to be virtually invisible. His camouflage was perfect, since the waiting room had a disorderly and demoralized air, too. Chairs and ashtrays had been moved away from the walls. The floor was paved with spattered dropcloths.
|
||||
|
||||
The room was being redecorated. It was being redecorated as a memorial to a man who had volunteered to die.
|
||||
|
||||
A sardonic old man, about two hundred years old, sat on a stepladder, painting a mural he did not like. Back in the days when people aged visibly, his age would have been guessed at thirty-five or so. Aging had touched him that much before the cure for aging was found.
|
||||
|
||||
The mural he was working on depicted a very neat garden. Men and women in white, doctors and nurses, turned the soil, planted seedlings, sprayed bugs, spread fertilizer.
|
||||
|
||||
Men and women in purple uniforms pulled up weeds, cut down plants that were old and sickly, raked leaves, carried refuse to trash-burners.
|
||||
|
||||
Never, never, never—not even in medieval Holland nor old Japan—had a garden been more formal, been better tended. Every plant had all the loam, light, water, air and nourishment it could use.
|
||||
|
||||
A hospital orderly came down the corridor, singing under his breath a popular song.
|
||||
|
||||
The orderly looked in at the mural and the muralist. "Looks so real," he said, "I can practically imagine I'm standing in the middle of it."
|
||||
|
||||
"What makes you think you're not in it?" said the painter. He gave a satiric smile. "It's called 'The Happy Garden of Life,' you know."
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env/ python
|
||||
# THIS SCRIPT ADAPTS THE SOURCE TEXT IN THE RIGHT READING FORMAT FOR THE ALGORITHM, CLEANING UP WHITE SPACES/SPLITTING INTO SENTENCES
|
||||
# source text is written in uppercase
|
||||
# remove white spaces, put everything in lowercase
|
||||
# split on punctuation
|
||||
# write in file capitalizing first letter
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit, An Mertens
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
import nltk.data
|
||||
|
||||
# split into sentences
|
||||
sentences = []
|
||||
finding_sentences = nltk.data.load('tokenizers/punkt/english.pickle')
|
||||
with open('../data/frankenstein_for_machines.txt', 'rt') as source:
|
||||
for line in source:
|
||||
# this returns a list with 1 element containing the entire text, sentences separated by \n
|
||||
sentences = '\n'.join(finding_sentences.tokenize(line.strip().lower().capitalize()))
|
||||
# transform string into list of sentences
|
||||
sentences = sentences.split("\n")
|
||||
|
||||
# write clean text to a file
|
||||
with open("frankenstein_for_machines_tf.txt", "w") as destination:
|
||||
for sentence in sentences:
|
||||
destination.write(sentence.strip().capitalize()+" ")
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
#!/usr/bin/env/ python
|
||||
|
||||
# This script creates a sorted frequency dictionary with stopwords.
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit, An Mertens
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import division
|
||||
from collections import Counter
|
||||
import string
|
||||
from nltk.corpus import stopwords
|
||||
|
||||
|
||||
# VARIABLES
|
||||
|
||||
|
||||
# textfiles
|
||||
source1 = open('../data/1984_fragment.txt', 'rt')
|
||||
source2 = open('../data/verne_fragment.txt', 'rt')
|
||||
destination1 = open('../data/counting_1984.txt', 'wt')
|
||||
destination2 = open('../data/counting_verne.txt', 'wt')
|
||||
|
||||
|
||||
# FUNCTIONS
|
||||
|
||||
# PREPROCESSING TEXT FILE
|
||||
## remove caps + breaks + punctuation
|
||||
def remove_punct(f):
|
||||
tokens = (' '.join(line.replace('\n', '') for line in f)).lower()
|
||||
for c in string.punctuation:
|
||||
tokens= tokens.replace(c,"")
|
||||
tokens = tokens.strip()
|
||||
#print("tokens", type(tokens))
|
||||
return tokens
|
||||
|
||||
## create frequency dictionary
|
||||
def freq_dict(tokens):
|
||||
tokens = tokens.split(" ")
|
||||
frequency_d = {}
|
||||
# tokens = tokens.split(" ")
|
||||
for token in tokens:
|
||||
try:
|
||||
frequency_d[token] += 1
|
||||
except KeyError:
|
||||
frequency_d[token] = 1
|
||||
return frequency_d
|
||||
|
||||
## sort words by frequency (import module)
|
||||
def sort_dict(frequency_d):
|
||||
c=Counter(frequency_d)
|
||||
frequency = c.most_common()
|
||||
return frequency
|
||||
|
||||
# write words in text file
|
||||
def write_to_file(frequency, g):
|
||||
for key, value in frequency:
|
||||
g.write(("{} : {} \n".format(key, value)))
|
||||
g.close()
|
||||
|
||||
|
||||
# Write new text into logbook
|
||||
def writetologbook(content):
|
||||
try:
|
||||
log = open(filename, "a")
|
||||
try:
|
||||
log.write(content)
|
||||
finally:
|
||||
log.close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
|
||||
# SCRIPT
|
||||
|
||||
# execute functions
|
||||
|
||||
tokens1 = remove_punct(source1)
|
||||
tokens2 = remove_punct(source2)
|
||||
|
||||
frequency_d1 = freq_dict(tokens1)
|
||||
frequency_d2 = freq_dict(tokens2)
|
||||
|
||||
frequency1 = sort_dict(frequency_d1)
|
||||
frequency2 = sort_dict(frequency_d2)
|
||||
|
||||
# Write in textfile
|
||||
|
||||
write_to_file(frequency1, destination1)
|
||||
write_to_file(frequency2, destination2)
|
||||
|
||||
source1.close()
|
||||
source2.close()
|
||||
|
||||
destination1.close()
|
||||
destination2.close()
|
||||
|
||||
|
||||
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
#!/usr/bin/env/ python
|
||||
|
||||
# This script creates a sorted frequency dictionary with stopwords
|
||||
|
||||
# Copyright (C) 2016 Constant, Algolit, An Mertens
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details: <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
from collections import Counter
|
||||
import string
|
||||
import nltk
|
||||
|
||||
|
||||
|
||||
'''
|
||||
This script creates a frequency dictionary of words used in a text filtering out stopwords
|
||||
'''
|
||||
|
||||
# VARIABLES
|
||||
|
||||
|
||||
|
||||
# textfiles
|
||||
source1 = open('../data/1984_fragment.txt', 'rt')
|
||||
source2 = open('../data/verne_fragment.txt', 'rt')
|
||||
destination1 = open('../data/grand_cru_counting_1984.txt', 'wt')
|
||||
destination2 = open('../data/grand_cru_counting_verne.txt', 'wt')
|
||||
|
||||
|
||||
freqwords = ["the", "a", "to", "of", "in", 'is', "with", "on", "for", "at", "from", "about",\
|
||||
"are", "an", "up", "out", "have", "be", "this", "one", "says", "as", "all", "just", "was", "so", "there", "not", "by",\
|
||||
"into", "been", "dont", "has", "over", "doesnt", "did", "had", "would", "could", "didnt"]
|
||||
relationals = ["she", "you", "i", "he", "we", "her", "his", "it", "its", "their", "me", "our", 'they', "us", "my",\
|
||||
"your", "theyre", 'them', "youre", "him", "were", "these"]
|
||||
subphrases = ["and", "that", "but", "like", "what", "if", "then","theres", "or", "which", "who", "while", "where", "when",\
|
||||
"thats", "how", "because"]
|
||||
|
||||
# removed "she", "you", "i", "he", "we",
|
||||
stopwords = ["the", "a", "to", "of", "in", 'is', "with", "on", "for", "at", "from", "about",\
|
||||
"are", "an", "up", "out", "have", "be", "this", "one", "says", "as", "all", "just", "was", "so",\
|
||||
"her", "his", "it", "its", "their", "me", "our",\
|
||||
"and", "that", "but", "like", "what", "if", "then", "there", "they", "us", "my", "your", "theres", "theyre", "or", "not",\
|
||||
"which", "by", "who", "them", "into", "while", "been", "dont", "where", "youre", "has", "when", "over", "him", "were", "doesnt",\
|
||||
"did", "thats", "how", "had", "these", "would", "could", "because", "didnt"]
|
||||
|
||||
|
||||
## FUNCTIONS
|
||||
|
||||
# PREPROCESSING TEXT FILE
|
||||
## remove caps + breaks + punctuation
|
||||
def remove_punct(f):
|
||||
tokens = (' '.join(line.replace('\n', '') for line in f)).lower()
|
||||
for c in string.punctuation:
|
||||
tokens= tokens.replace(c,"")
|
||||
tokens = tokens.strip()
|
||||
#print("tokens", type(tokens))
|
||||
return tokens
|
||||
|
||||
# remove stopwords
|
||||
def remove_stopwords(tokens):
|
||||
tokens = tokens.split(" ")
|
||||
words =[]
|
||||
for token in tokens:
|
||||
if token not in stopwords:
|
||||
words.append(token)
|
||||
return words
|
||||
|
||||
## create frequency dictionary
|
||||
def freq_dict(words):
|
||||
frequency_d = {}
|
||||
# tokens = tokens.split(" ")
|
||||
for word in words:
|
||||
try:
|
||||
frequency_d[word] += 1
|
||||
except KeyError:
|
||||
frequency_d[word] = 1
|
||||
return frequency_d
|
||||
|
||||
## sort words by frequency (import module)
|
||||
def sort_dict(frequency_d):
|
||||
c=Counter(frequency_d)
|
||||
frequency = c.most_common()
|
||||
return frequency
|
||||
|
||||
# write words in text file
|
||||
def write_to_file(frequency, destination):
|
||||
for key, value in frequency:
|
||||
destination.write(("{} : {} \n".format(key, value)))
|
||||
destination.close()
|
||||
|
||||
|
||||
# Write new text into logbook
|
||||
def writetologbook(content):
|
||||
try:
|
||||
log = open(filename, "a")
|
||||
try:
|
||||
log.write(content)
|
||||
finally:
|
||||
log.close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
|
||||
## SCRIPT
|
||||
|
||||
# execute functions
|
||||
tokens1 = remove_punct(source1)
|
||||
tokens2 = remove_punct(source2)
|
||||
|
||||
words1 = remove_stopwords(tokens1)
|
||||
words2 = remove_stopwords(tokens2)
|
||||
|
||||
frequency_d1 = freq_dict(words1)
|
||||
frequency_d2 = freq_dict(words2)
|
||||
|
||||
frequency1 = sort_dict(frequency_d1)
|
||||
frequency2 = sort_dict(frequency_d2)
|
||||
|
||||
write_to_file(frequency1, destination1)
|
||||
write_to_file(frequency2, destination2)
|
||||
|
||||
source1.close()
|
||||
source2.close()
|
||||
|
||||
destination1.close()
|
||||
destination2.close()
|
||||
|
||||
# -------------------------------------------
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,54 @@
|
||||
from collections import Counter
|
||||
import nltk
|
||||
import re
|
||||
import pickle
|
||||
|
||||
|
||||
# VARIABLES
|
||||
|
||||
source = open("../data/1984_fragment.txt", "r")
|
||||
destination = open("../data/1984_fragment_trigrams.txt", "w")
|
||||
destination.write("OBAMA\S MOST FREQUENT TRIGRAMS with Penn's TREEBANK\n\n\n")
|
||||
|
||||
|
||||
# FUNCTIONS
|
||||
## sort words by frequency (import module)
|
||||
def sort_dict(frequency_d):
|
||||
c=Counter(frequency_d)
|
||||
frequency = c.most_common()
|
||||
return frequency
|
||||
|
||||
## MAKE SURE ALL VARIABLES ARE DECLARED WITHIN THE LOOPS
|
||||
|
||||
# 1. Create dictionary of trigrams
|
||||
trigrams = {}
|
||||
for line in source:
|
||||
# remove punctuation
|
||||
clean_tri = []
|
||||
words = line.split(" ")
|
||||
for word in words:
|
||||
cleaning = re.compile(r"[A-Za-z0-9]")
|
||||
if cleaning.match(word):
|
||||
clean_tri.append(word)
|
||||
else:
|
||||
pass
|
||||
# find trigrams
|
||||
tricount = nltk.trigrams(clean_tri)
|
||||
# count frequency of each trigram and add trigram + value in dictionary
|
||||
for trigram in tricount:
|
||||
if trigram in trigrams:
|
||||
trigrams[trigram] += 1
|
||||
else:
|
||||
trigrams[trigram] = 1
|
||||
|
||||
trigrams_sorted = sort_dict(trigrams)
|
||||
first10pairs = trigrams_sorted[:10]
|
||||
|
||||
|
||||
with destination as text:
|
||||
for tri, frequency in first10pairs:
|
||||
text.write("{} : {} \n".format(tri, frequency))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# this script works in Python2
|
||||
|
||||
from __future__ import division
|
||||
import nltk
|
||||
from pattern.en import tag
|
||||
import nltk.data
|
||||
from random import shuffle, choice
|
||||
|
||||
|
||||
# VARIABLES
|
||||
|
||||
|
||||
# texts
|
||||
source = open("../data/1984_fragment.txt", "r")
|
||||
destination = open("../data/1984_fragment_pos.txt", "wt")
|
||||
destination.write("1984\S SYNTAX using PENN'S TREEBANK\n\n")
|
||||
|
||||
|
||||
|
||||
# FUNCTIONS
|
||||
|
||||
## SCRIPT
|
||||
|
||||
# select 1 or more sentences from source
|
||||
## split source text into list of sentences
|
||||
finding_sentences = nltk.data.load('tokenizers/punkt/english.pickle')
|
||||
sentences_list = []
|
||||
with source as text0:
|
||||
for line in text0:
|
||||
# this returns a list with 1 element containing the entire text, sentences separated by \n
|
||||
sentences = '\n'.join(finding_sentences.tokenize(line.decode('utf-8').strip()))
|
||||
# transform string into list of sentences
|
||||
sentences_list = sentences.split("\n")
|
||||
print("sentences list", sentences_list)
|
||||
|
||||
with destination as text1:
|
||||
for sentence in sentences_list:
|
||||
# create tuple of tuples with pairs of word + POS-tag
|
||||
collection = tag(sentence, tokenize=True, encoding='utf-8')
|
||||
# transform tuple into list to be able to manipulate it
|
||||
collection = list(collection)
|
||||
for element in collection:
|
||||
text1.write(element[1] + " ")
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import re
|
||||
|
||||
|
||||
source = open("../data/1984_fragment.txt", "r")
|
||||
#source = open("joyce.txt", "r")
|
||||
destination = open("../data/1984_no_digits.txt", "w")
|
||||
|
||||
|
||||
sentences = []
|
||||
for line in source:
|
||||
result = ''.join([i for i in line if not i.isdigit()])
|
||||
destination.write(result)
|
||||
|
||||
source.close()
|
||||
destination.close()
|
||||
@@ -0,0 +1,40 @@
|
||||
|
||||
animated gif
|
||||
_____________
|
||||
|
||||
# all images have width of 360 and keep aspect ratio, are overwritten
|
||||
mogrify '*.JPG[360x]'
|
||||
# all images have width of 360 and keep aspect ratio, are renamed
|
||||
convert '*.jpg[200x]' resized%03d.png
|
||||
|
||||
mogrify -resize 640x480 *.JPG
|
||||
convert -delay 140 -loop 0 *.JPG uitnodiging.gif
|
||||
convert -delay 200 0.JPG 1.JPG 2.JPG 3.JPG 4.JPG 5.JPG 6.JPG 7.JPG 8.JPG 9.JPG 10.JPG 11.JPG 12.JPG 13.JPG 14.JPG 15.JPG 16.JPG 17.JPG 18.JPG 19.JPG 21.JPG 22.JPG 23.JPG 24.JPG 25.JPG 26.JPG 27.JPG 28.JPG 29.JPG 30.JPG 31.JPG 32.JPG 33.JPG 34.JPG -loop 0 uitnodiging.gif
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Ssssssssssst!' label0.JPG
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Top Secret!' 1_label7.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Laatste Tuinfeest' label1.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Verrassing voor\n\nJuliette & Michel' 1_label8.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'28 mei 2017\n\n15u' label1.JPG label3.JPG
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Houtseweg 33\n\n2340 Beerse' label4.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 42 -tile pattern:checkerboard -size 640x480 -gravity center label:'Het huis is leeg.\n\n Water en elektriciteit\n zijn afgesloten.' label5.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 42 -tile pattern:checkerboard -size 640x480 -gravity center label:'Daar hebben wij,\n de kinderen,\n oplossingen voor gevonden.' label6.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 42 -tile pattern:checkerboard -size 640x480 -gravity center label:'Wij zorgen voor\n een hapje en een drankje.' label7.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 42 -tile pattern:checkerboard -size 640x480 -gravity center label:'Brengen jullie graag mee:\n\n een klapstoel,\n een goed humeur,\n herinneringen aan het huis.' label8.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 42 -tile pattern:checkerboard -size 640x480 -gravity center label:'En potjes aarde,\n\n als je een plantje\n uit de tuin wil.' label9.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Graag\nbevestiging\n voor 15 mei' label10.JPG
|
||||
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Hopelijk\ntot dan!' 28.JPG
|
||||
|
||||
convert -background lime -fill green -font AvantGarde-Book -pointsize 72 -tile pattern:checkerboard -size 640x480 -gravity center label:'Erik, Jan, \n An, Geert, \n Olivia, Giulia' label12.JPG
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
# coding: utf8
|
||||
|
||||
# More options with Wordnet: http://www.nltk.org/howto/wordnet.html
|
||||
|
||||
from nltk.corpus import wordnet as wn
|
||||
|
||||
print([synset.lemma_names('fra') for synset in wn.synsets('chien', lang='fra')])
|
||||
|
||||
'''
|
||||
[['canis_familiaris', 'chien'], ['aboyeur', 'chien', 'chienchien', 'clébard', 'toutou'], ['chien', 'chien_de_chasse'], ['chien'], ['chien', 'clic', 'cliquer', 'cliquet'], ['chien', 'franc', 'hot-dog'], ['achille', 'chien', 'quignon', 'talon'], ['chien'], ['chien']
|
||||
'''
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#ce script permet d'ouvrir un fichier texte, de supprimer les voyelles et d'enregistrer le nouveau texte dans le fichier phrase.txt
|
||||
|
||||
#défini la liste des voyelles
|
||||
list_voyelles=["a", "e", "é", "è", "ë", "ê", "i", "ï", "o", "u", "ù", "y"]
|
||||
|
||||
# définir "new_word" comme une liste
|
||||
new_words = []
|
||||
|
||||
with open("consommez.txt","r") as source: #ouvre un fichier texte pour le lire (r) pour read, on l'appelle "source"
|
||||
for line in source: #pour chaque ligne de "source"…
|
||||
words = line.split() #découpe les lignes en mots mis dans la liste "words"
|
||||
for word in words: #pour chaque mot "word" dans la liste "words"
|
||||
if len(word)>3: #condition pour ne pas affecter les mots courts
|
||||
lettre1=word[0] #on isole la première lettre du mot pour ne pas l'affecter
|
||||
reste_mot=word[1:] #on garde la chaine de caractère au delà de la position #1
|
||||
for v in list_voyelles: #pour chaque caractère v de la list_voyelles
|
||||
reste_mot = reste_mot.replace(v,"") #remplacer v par rien, dans le mot sans prendre en compte la première lettre défini par "reste_mot"
|
||||
word=lettre1+reste_mot #on recolle le premier caractère avec le reste de la chaîne
|
||||
new_words.append(word) #remettre chaque "word" dans la liste new_words
|
||||
else:
|
||||
new_words.append(word) ##remettre les "word" non affecté par la condition dans la liste new_words
|
||||
print(" ".join(new_words)) #recomposer la phrase d'après la liste new_words
|
||||
with open("consonnez.txt","w") as destination: #ouvre ou crée un fichier phrase.txt et remplace ou crée le texte destination (w) pour write
|
||||
destination.write(" ".join(new_words)) #recomposer la phrase d'après la liste new_words et écrire le texte dans "destination"
|
||||
@@ -0,0 +1,6 @@
|
||||
Les 120 enseignes de l'habillement trouvent un accord pour ouvrir le dimanche
|
||||
|
||||
Le travail du dimanche vient de franchir un pas de géant. La Fédération des enseignes de l'habillement vient de signer avec les partenaires sociaux du commerce succursaliste un accord social sur la dérogation au repos dominical dans la cadre de la loi Macron s'appliquant dans les zones touristiques internationales. Un cap décisif car il s'agit du plus important accord de branche autorisant le travail le dimanche signé à ce jour. Il concerne en effet plus de 120 enseignes, comme Kiabi, H&M, Celio ou Camaïeu, soit 22.000 points de vente et près de 120.000 salariés. Il a fallu plus d'un an à la fédération et aux organisations syndicales pour trouver un terrain d'entente. Pour les salariés qui se porteront volontaires, les parties ont validé le doublement de la rémunération des heures effectuées le dimanche. De plus, « le repos compensateur sera rémunéré pour les heures supplémentaires effectuées ce jour-là ", indique la Fédération des enseignes de l'habillement. Il sera possible pour ceux qui le veulent de revenir sur leur décision et de bénéficier d'un dimanche qui n'était pas prévu, « en cas d'indisponibilité ponctuelle ".
|
||||
Un impact favorable sur l'emploi
|
||||
Le plafond a été fixé à 26 dimanches travaillés par an, sauf si le salarié veut en faire plus. En échange, les enseignes se sont engagées à financer les frais de garde des enfants, et ce à hauteur de 40 euros maximum par dimanche travaillé. « Cet accord est une excellente nouvelle pour nos enseignes, qui traversent des moments difficiles depuis plusieurs années. Les magasins d'habillement, à l'instar des grands magasins, vont enfin pouvoir bénéficier de la clientèle dominicale », a indiqué Christstian Pimont, le président de l'Alliance du commerce. Ces ouvertures devraient aussi avoir un impact favorable sur l'emploi. Les partenaires sociaux estiment que 850 postes seront maintenus grâce au chiffre d'affaires supplémentaire attendu du dimanche et 250 emplois nouveaux créés. Cet accord de branche est le quatrième signé en France dans le commerce concernant le travail dominical, après le bricolage (qui dispose d'une dérogation de plein droit, la couture parisienne et la bijouterie-joaillerie).
|
||||
Les échos.fr du 7/7/17
|
||||
@@ -0,0 +1 @@
|
||||
Ls 120 ensgns de l'hbllmnt trvnt un accrd pr ovrr le dmnch Le trvl du dmnch vnt de frnchr un pas de gnt. La Fdrtn des ensgns de l'hbllmnt vnt de sgnr avc les prtnrs scx du cmmrc sccrslst un accrd scl sur la drgtn au rps dmncl dns la cdr de la loi Mcrn s'pplqnt dns les zns trstqs intrntnls. Un cap dcsf car il s'gt du pls imprtnt accrd de brnch atrsnt le trvl le dmnch sgn à ce jr. Il cncrn en efft pls de 120 ensgns, cmm Kb, H&M, Cl ou Cm, st 22.000 pnts de vnt et prs de 120.000 slrs. Il a fll pls d'n an à la fdrtn et aux orgnstns sndcls pr trvr un trrn d'ntnt. Pr les slrs qui se prtrnt vlntrs, les prts ont vld le dblmnt de la rmnrtn des hrs effcts le dmnch. De pls, « le rps cmpnstr sr rmnr pr les hrs spplmntrs effcts ce jr-là ", indq la Fdrtn des ensgns de l'hbllmnt. Il sr pssbl pr cx qui le vlnt de rvnr sur lr dcsn et de bnfcr d'n dmnch qui n'tt pas prv, « en cas d'ndspnblt pnctll ". Un impct fvrbl sur l'mpl Le plfnd a été fx à 26 dmnchs trvlls par an, sf si le slr vt en fr pls. En échng, les ensgns se snt enggs à fnncr les frs de grd des enfnts, et ce à htr de 40 ers mxmm par dmnch trvll. « Cet accrd est une excllnt nvll pr nos ensgns, qui trvrsnt des mmnts dffcls dps plsrs anns. Les mgsns d'hbllmnt, à l'nstr des grnds mgsns, vnt enfn pvr bnfcr de la clntl dmncl », a indq Chrstn Pmnt, le prsdnt de l'Allnc du cmmrc. Ces ovrtrs dvrnt ass avr un impct fvrbl sur l'mpl. Les prtnrs scx estmnt que 850 psts srnt mntns grâc au chffr d'ffrs spplmntr attnd du dmnch et 250 empls nvx crs. Cet accrd de brnch est le qtrm sgn en Frnc dns le cmmrc cncrnnt le trvl dmncl, aprs le brclg (q dsps d'n drgtn de pln drt, la ctr prsnn et la bjtr-jllr). Les échs.fr du 7/7/17
|
||||
+1523
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
78910
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. Winston Smith, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. Winston made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and Winston, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. Winston turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the Party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.
|
||||
Outside, even through the shut window-pane, the world looked cold. Down in the street little eddies of wind were whirling dust and torn paper into spirals, and though the sun was shining and the sky a harsh blue, there seemed to be no colour in anything, except the posters that were plastered everywhere. The black-moustachio’d face gazed down from every commanding corner. There was one on the house-front immediately opposite. BIG BROTHER IS WATCHING YOU, the caption said, while the dark eyes looked deep into Winston’s own. Down at street level another poster, torn at one corner, flapped fitfully in the wind, alternately covering and uncovering the single word INGSOC. In the far distance a helicopter skimmed down between the roofs, hovered for an instant like a bluebottle, and darted away again with a curving flight. It was the police patrol, snooping into people's windows. The patrols did not matter, however. Only the Thought Police mattered. Behind Winston's back the voice from the telescreen was still babbling away about pig-iron and the overfulfilment of the Ninth Three-Year Plan. The telescreen received and transmitted simultaneously. Any sound that Winston made, above the level of a very low whisper, would be picked up by it; moreover, so long as he remained within the field of vision which the metal plaque commanded, he could be seen as well as heard. There was of course no way of knowing whether you were being watched at any given moment. How often, or on what system, the Thought Police plugged in on any individual wire was guesswork. It was even conceivable that they watched everybody all the time. But at any rate they could plug in your wire whenever they wanted to. You had to live - did live, from habit that became instinct - in the assumption that every sound you made was overheard, and, except in darkness, every movement scrutinised.
|
||||
Winston kept his back turned to the telescreen. It was safer; though, as he well knew, even a back can be revealing. A kilometre away the Ministry of Truth, his place of work, towered vast and white above the grimy landscape. This, he thought with a sort of vague distaste - this was London, chief city of Airstrip One, itself the third most populous of the provinces of Oceania. He tried to squeeze out some childhood memory that should tell him whether London had always been quite like this. Were there always these vistas of rotting nineteenth-century houses, their sides shored up with baulks of timber, their windows patched with cardboard and their roofs with corrugated iron, their crazy garden walls sagging in all directions? And the bombed sites where the plaster dust swirled in the air and the willowherb straggled over the heaps of rubble; and the places where the bombs had cleared a larger patch and there had sprung up sordid colonies of wooden dwellings like chicken-houses? But it was no use, he could not remember: nothing remained of his childhood except a series of bright-lit tableaux, occurring against no background and mostly unintelligible.
|
||||
@@ -0,0 +1,3 @@
|
||||
1984\S SYNTAX using PENN'S TREEBANK
|
||||
|
||||
NNP VBD PRP$ NN VBD TO DT NN . PRP VBD JJR : IN , IN PRP RB VBD , RB DT RB MD VB VBG . DT VB RB DT NNP IN NN , PRP$ NN IN NN , VBD JJ CC JJ IN DT JJ NN . DT , PRP VBD IN DT NN IN JJ NN : DT VBD NNP-LOC , JJ NN IN NNP CD , PRP DT JJ RBS JJ IN DT NNS IN NNP . PRP VBD TO VB RP DT NN NN WDT MD VB PRP IN NNP-LOC VBD RB VBN RB IN DT . WRB RB RB DT NNS IN VBG JJ NNS , PRP$ NNS VBN RP IN NNS IN NN , PRP$ NNS VBN IN NN CC PRP$ NNS IN JJ NN , PRP$ JJ NN NNS VBG IN DT NNS . CC DT JJ NNS WRB DT NN NN VBD IN DT NN CC DT NN VBD IN DT NNS IN NN : CC DT NNS WRB DT NNS VBD VBN DT JJR NN CC EX VBD VBN RP JJ NNS IN JJ NNS IN NNS . CC PRP VBD DT NN , PRP MD RB VB : NN VBD IN PRP$ NN IN DT NN IN JJ NN , VBG IN DT NN CC RB JJ .
|
||||
@@ -0,0 +1,13 @@
|
||||
OBAMA\S MOST FREQUENT TRIGRAMS with Penn's TREEBANK
|
||||
|
||||
|
||||
('IS', 'WATCHING', 'YOU,') : 2
|
||||
('BIG', 'BROTHER', 'IS') : 2
|
||||
('the', 'wall.', 'It') : 2
|
||||
('the', 'Thought', 'Police') : 2
|
||||
('no', 'way', 'of') : 2
|
||||
('part', 'of', 'the') : 2
|
||||
('BROTHER', 'IS', 'WATCHING') : 2
|
||||
('YOU,', 'the', 'caption') : 2
|
||||
('WATCHING', 'YOU,', 'the') : 2
|
||||
('picked', 'up', 'by') : 1
|
||||
@@ -0,0 +1,9 @@
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. Winston Smith, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. Winston made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and Winston, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. Winston turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the Party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.
|
||||
Outside, even through the shut window-pane, the world looked cold. Down in the street little eddies of wind were whirling dust and torn paper into spirals, and though the sun was shining and the sky a harsh blue, there seemed to be no colour in anything, except the posters that were plastered everywhere. The black-moustachio’d face gazed down from every commanding corner. There was one on the house-front immediately opposite. BIG BROTHER IS WATCHING YOU, the caption said, while the dark eyes looked deep into Winston’s own. Down at street level another poster, torn at one corner, flapped fitfully in the wind, alternately covering and uncovering the single word INGSOC. In the far distance a helicopter skimmed down between the roofs, hovered for an instant like a bluebottle, and darted away again with a curving flight. It was the police patrol, snooping into people's windows. The patrols did not matter, however. Only the Thought Police mattered. Behind Winston's back the voice from the telescreen was still babbling away about pig-iron and the overfulfilment of the Ninth Three-Year Plan. The telescreen received and transmitted simultaneously. Any sound that Winston made, above the level of a very low whisper, would be picked up by it; moreover, so long as he remained within the field of vision which the metal plaque commanded, he could be seen as well as heard. There was of course no way of knowing whether you were being watched at any given moment. How often, or on what system, the Thought Police plugged in on any individual wire was guesswork. It was even conceivable that they watched everybody all the time. But at any rate they could plug in your wire whenever they wanted to. You had to live - did live, from habit that became instinct - in the assumption that every sound you made was overheard, and, except in darkness, every movement scrutinised.
|
||||
Winston kept his back turned to the telescreen. It was safer; though, as he well knew, even a back can be revealing. A kilometre away the Ministry of Truth, his place of work, towered vast and white above the grimy landscape. This, he thought with a sort of vague distaste - this was London, chief city of Airstrip One, itself the third most populous of the provinces of Oceania. He tried to squeeze out some childhood memory that should tell him whether London had always been quite like this. Were there always these vistas of rotting nineteenth-century houses, their sides shored up with baulks of timber, their windows patched with cardboard and their roofs with corrugated iron, their crazy garden walls sagging in all directions? And the bombed sites where the plaster dust swirled in the air and the willowherb straggled over the heaps of rubble; and the places where the bombs had cleared a larger patch and there had sprung up sordid colonies of wooden dwellings like chicken-houses? But it was no use, he could not remember: nothing remained of his childhood except a series of bright-lit tableaux, occurring against no background and mostly unintelligible.
|
||||
+392
@@ -0,0 +1,392 @@
|
||||
: 8
|
||||
he : 7
|
||||
you : 7
|
||||
no : 6
|
||||
winston : 6
|
||||
face : 5
|
||||
though : 4
|
||||
voice : 4
|
||||
any : 4
|
||||
even : 4
|
||||
down : 4
|
||||
telescreen : 4
|
||||
every : 3
|
||||
back : 3
|
||||
wall : 3
|
||||
made : 3
|
||||
part : 3
|
||||
thought : 3
|
||||
above : 3
|
||||
wind : 3
|
||||
dust : 3
|
||||
police : 3
|
||||
cold : 3
|
||||
poster : 3
|
||||
away : 3
|
||||
except : 3
|
||||
way : 3
|
||||
live : 2
|
||||
watching : 2
|
||||
flat : 2
|
||||
very : 2
|
||||
watched : 2
|
||||
level : 2
|
||||
off : 2
|
||||
i : 2
|
||||
corner : 2
|
||||
sound : 2
|
||||
torn : 2
|
||||
quickly : 2
|
||||
turned : 2
|
||||
wire : 2
|
||||
london : 2
|
||||
always : 2
|
||||
well : 2
|
||||
enormous : 2
|
||||
eyes : 2
|
||||
windows : 2
|
||||
childhood : 2
|
||||
blue : 2
|
||||
remained : 2
|
||||
looked : 2
|
||||
times : 2
|
||||
use : 2
|
||||
plaque : 2
|
||||
roofs : 2
|
||||
pigiron : 2
|
||||
lift : 2
|
||||
big : 2
|
||||
caption : 2
|
||||
metal : 2
|
||||
street : 2
|
||||
gazed : 2
|
||||
through : 2
|
||||
opposite : 2
|
||||
whether : 2
|
||||
brother : 2
|
||||
still : 2
|
||||
movement : 1
|
||||
fitfully : 1
|
||||
sagging : 1
|
||||
sprung : 1
|
||||
razor : 1
|
||||
conceivable : 1
|
||||
pictures : 1
|
||||
overheard : 1
|
||||
low : 1
|
||||
vague : 1
|
||||
winston’s : 1
|
||||
overalls : 1
|
||||
simply : 1
|
||||
flight : 1
|
||||
cleared : 1
|
||||
course : 1
|
||||
fortyfive : 1
|
||||
somewhat : 1
|
||||
stairs : 1
|
||||
sank : 1
|
||||
went : 1
|
||||
work : 1
|
||||
cut : 1
|
||||
crazy : 1
|
||||
during : 1
|
||||
kept : 1
|
||||
words : 1
|
||||
corrugated : 1
|
||||
old : 1
|
||||
seemed : 1
|
||||
snooping : 1
|
||||
hours : 1
|
||||
depicted : 1
|
||||
beneath : 1
|
||||
contrived : 1
|
||||
ruggedly : 1
|
||||
bombed : 1
|
||||
vast : 1
|
||||
list : 1
|
||||
chapter : 1
|
||||
entering : 1
|
||||
ulcer : 1
|
||||
winstons : 1
|
||||
unintelligible : 1
|
||||
ran : 1
|
||||
garden : 1
|
||||
wide : 1
|
||||
cabbage : 1
|
||||
seldom : 1
|
||||
slipped : 1
|
||||
assumption : 1
|
||||
thirteen : 1
|
||||
curving : 1
|
||||
whenever : 1
|
||||
oceania : 1
|
||||
drive : 1
|
||||
babbling : 1
|
||||
became : 1
|
||||
something : 1
|
||||
within : 1
|
||||
ministry : 1
|
||||
habit : 1
|
||||
vistas : 1
|
||||
reading : 1
|
||||
boiled : 1
|
||||
rubble : 1
|
||||
electric : 1
|
||||
own : 1
|
||||
ended : 1
|
||||
patch : 1
|
||||
windowpane : 1
|
||||
formed : 1
|
||||
city : 1
|
||||
working : 1
|
||||
little : 1
|
||||
distance : 1
|
||||
fruity : 1
|
||||
anything : 1
|
||||
production : 1
|
||||
uncovering : 1
|
||||
more : 1
|
||||
tacked : 1
|
||||
series : 1
|
||||
threeyear : 1
|
||||
spirals : 1
|
||||
often : 1
|
||||
time : 1
|
||||
instant : 1
|
||||
overfulfilment : 1
|
||||
dwellings : 1
|
||||
slowly : 1
|
||||
chin : 1
|
||||
swirl : 1
|
||||
day : 1
|
||||
economy : 1
|
||||
darkness : 1
|
||||
place : 1
|
||||
dulled : 1
|
||||
third : 1
|
||||
preparation : 1
|
||||
prevent : 1
|
||||
soap : 1
|
||||
provinces : 1
|
||||
skimmed : 1
|
||||
flights : 1
|
||||
hallway : 1
|
||||
moreover : 1
|
||||
best : 1
|
||||
eddies : 1
|
||||
immediately : 1
|
||||
resting : 1
|
||||
shutting : 1
|
||||
white : 1
|
||||
flapped : 1
|
||||
world : 1
|
||||
remember : 1
|
||||
nuzzled : 1
|
||||
dimmed : 1
|
||||
smelt : 1
|
||||
trying : 1
|
||||
came : 1
|
||||
those : 1
|
||||
places : 1
|
||||
coloured : 1
|
||||
naturally : 1
|
||||
posters : 1
|
||||
harsh : 1
|
||||
truth : 1
|
||||
shut : 1
|
||||
towered : 1
|
||||
mostly : 1
|
||||
plan : 1
|
||||
colour : 1
|
||||
outside : 1
|
||||
most : 1
|
||||
display : 1
|
||||
man : 1
|
||||
scrutinised : 1
|
||||
wanted : 1
|
||||
moved : 1
|
||||
several : 1
|
||||
matter : 1
|
||||
darted : 1
|
||||
tell : 1
|
||||
hate : 1
|
||||
seven : 1
|
||||
sanguine : 1
|
||||
sun : 1
|
||||
commanded : 1
|
||||
some : 1
|
||||
patrols : 1
|
||||
chief : 1
|
||||
between : 1
|
||||
covering : 1
|
||||
bombs : 1
|
||||
should : 1
|
||||
safer : 1
|
||||
follow : 1
|
||||
directions : 1
|
||||
sordid : 1
|
||||
emphasized : 1
|
||||
hovered : 1
|
||||
colonies : 1
|
||||
timber : 1
|
||||
smallish : 1
|
||||
patrol : 1
|
||||
each : 1
|
||||
indoor : 1
|
||||
field : 1
|
||||
skin : 1
|
||||
iron : 1
|
||||
thirtynine : 1
|
||||
mattered : 1
|
||||
blades : 1
|
||||
mats : 1
|
||||
given : 1
|
||||
squeeze : 1
|
||||
daylight : 1
|
||||
moustache : 1
|
||||
revealing : 1
|
||||
sort : 1
|
||||
alternately : 1
|
||||
shored : 1
|
||||
individual : 1
|
||||
coarse : 1
|
||||
simultaneously : 1
|
||||
however : 1
|
||||
called : 1
|
||||
body : 1
|
||||
system : 1
|
||||
commanding : 1
|
||||
rate : 1
|
||||
said : 1
|
||||
houses : 1
|
||||
sky : 1
|
||||
clocks : 1
|
||||
rag : 1
|
||||
glass : 1
|
||||
background : 1
|
||||
meagreness : 1
|
||||
end : 1
|
||||
instinct : 1
|
||||
fair : 1
|
||||
doors : 1
|
||||
figures : 1
|
||||
landscape : 1
|
||||
populous : 1
|
||||
present : 1
|
||||
merely : 1
|
||||
everywhere : 1
|
||||
breast : 1
|
||||
winter : 1
|
||||
walls : 1
|
||||
deep : 1
|
||||
occurring : 1
|
||||
ingsoc : 1
|
||||
swirled : 1
|
||||
week : 1
|
||||
black : 1
|
||||
ankle : 1
|
||||
escape : 1
|
||||
april : 1
|
||||
blackmoustachio’d : 1
|
||||
tried : 1
|
||||
features : 1
|
||||
being : 1
|
||||
itself : 1
|
||||
bluebottle : 1
|
||||
quite : 1
|
||||
smith : 1
|
||||
transmitted : 1
|
||||
knowing : 1
|
||||
guesswork : 1
|
||||
wooden : 1
|
||||
distaste : 1
|
||||
plugged : 1
|
||||
metre : 1
|
||||
plug : 1
|
||||
received : 1
|
||||
chickenhouses : 1
|
||||
surface : 1
|
||||
patched : 1
|
||||
seen : 1
|
||||
peoples : 1
|
||||
housefront : 1
|
||||
long : 1
|
||||
gritty : 1
|
||||
do : 1
|
||||
whirling : 1
|
||||
plastered : 1
|
||||
bright : 1
|
||||
shaft : 1
|
||||
whisper : 1
|
||||
heaps : 1
|
||||
too : 1
|
||||
behind : 1
|
||||
again : 1
|
||||
party : 1
|
||||
roughened : 1
|
||||
word : 1
|
||||
along : 1
|
||||
hair : 1
|
||||
moment : 1
|
||||
right : 1
|
||||
move : 1
|
||||
straggled : 1
|
||||
another : 1
|
||||
frail : 1
|
||||
varicose : 1
|
||||
plaster : 1
|
||||
paper : 1
|
||||
current : 1
|
||||
grimy : 1
|
||||
switch : 1
|
||||
sites : 1
|
||||
mirror : 1
|
||||
landing : 1
|
||||
oblong : 1
|
||||
tableaux : 1
|
||||
helicopter : 1
|
||||
dark : 1
|
||||
than : 1
|
||||
sides : 1
|
||||
heavy : 1
|
||||
cardboard : 1
|
||||
striking : 1
|
||||
instrument : 1
|
||||
rotting : 1
|
||||
airstrip : 1
|
||||
nothing : 1
|
||||
everybody : 1
|
||||
willowherb : 1
|
||||
can : 1
|
||||
completely : 1
|
||||
vile : 1
|
||||
kilometre : 1
|
||||
only : 1
|
||||
blunt : 1
|
||||
victory : 1
|
||||
heard : 1
|
||||
window : 1
|
||||
vision : 1
|
||||
large : 1
|
||||
far : 1
|
||||
shining : 1
|
||||
brightlit : 1
|
||||
single : 1
|
||||
knew : 1
|
||||
inside : 1
|
||||
ninth : 1
|
||||
uniform : 1
|
||||
baulks : 1
|
||||
nineteenthcentury : 1
|
||||
enough : 1
|
||||
picked : 1
|
||||
memory : 1
|
||||
effort : 1
|
||||
air : 1
|
||||
figure : 1
|
||||
handsome : 1
|
||||
distinguishable : 1
|
||||
against : 1
|
||||
mansions : 1
|
||||
larger : 1
|
||||
righthand : 1
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
des : 6
|
||||
de : 6
|
||||
et : 5
|
||||
les : 4
|
||||
sans : 2
|
||||
un : 2
|
||||
continents : 2
|
||||
plus : 1
|
||||
navires : 1
|
||||
états : 1
|
||||
point : 1
|
||||
négociants : 1
|
||||
particulièrement : 1
|
||||
1866 : 1
|
||||
phénomène : 1
|
||||
public : 1
|
||||
événement : 1
|
||||
oublié : 1
|
||||
agitaient : 1
|
||||
populations : 1
|
||||
inexpliqué : 1
|
||||
haut : 1
|
||||
au : 1
|
||||
deux : 1
|
||||
furent : 1
|
||||
lannée : 1
|
||||
surexcitaient : 1
|
||||
mer : 1
|
||||
divers : 1
|
||||
militaires : 1
|
||||
leurope : 1
|
||||
préoccupèrent : 1
|
||||
qui : 1
|
||||
émus : 1
|
||||
lesprit : 1
|
||||
na : 1
|
||||
tous : 1
|
||||
skippers : 1
|
||||
inexplicable : 1
|
||||
personne : 1
|
||||
se : 1
|
||||
bizarre : 1
|
||||
capitaines : 1
|
||||
rumeurs : 1
|
||||
ports : 1
|
||||
masters : 1
|
||||
à : 1
|
||||
marquée : 1
|
||||
marines : 1
|
||||
lamérique : 1
|
||||
par : 1
|
||||
fait : 1
|
||||
armateurs : 1
|
||||
parler : 1
|
||||
après : 1
|
||||
ce : 1
|
||||
lintérieur : 1
|
||||
pays : 1
|
||||
eux : 1
|
||||
gens : 1
|
||||
doute : 1
|
||||
officiers : 1
|
||||
fut : 1
|
||||
gouvernements : 1
|
||||
que : 1
|
||||
@@ -0,0 +1,73 @@
|
||||
Original text
|
||||
-------------
|
||||
|
||||
Part I
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. Winston Smith, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. Winston made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and Winston, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. François Hollande, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. François made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and François, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. Winston turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the Party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. François Hollande, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. François made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and François, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. François turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the Party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.
|
||||
Outside, even through the shut window-pane, the world looked cold. Down in the street little eddies of wind were whirling dust and torn paper into spirals, and though the sun was shining and the sky a harsh blue, there seemed to be no colour in anything, except the posters that were plastered everywhere. The black-moustachio’d face gazed down from every commanding corner. There was one on the house-front immediately opposite. BIG BROTHER IS WATCHING YOU, the caption said, while the dark eyes looked deep into Winston’s own. Down at street level another poster, torn at one corner, flapped fitfully in the wind, alternately covering and uncovering the single word INGSOC. In the far distance a helicopter skimmed down between the roofs, hovered for an instant like a bluebottle, and darted away again with a curving flight. It was the police patrol, snooping into people's windows. The patrols did not matter, however. Only the Thought Police mattered. Behind Winston's back the voice from the telescreen was still babbling away about pig-iron and the overfulfilment of the Ninth Three-Year Plan. The telescreen received and transmitted simultaneously. Any sound that Winston made, above the level of a very low whisper, would be picked up by it; moreover, so long as he remained within the field of vision which the metal plaque commanded, he could be seen as well as heard. There was of course no way of knowing whether you were being watched at any given moment. How often, or on what system, the Thought Police plugged in on any individual wire was guesswork. It was even conceivable that they watched everybody all the time. But at any rate they could plug in your wire whenever they wanted to. You had to live - did live, from habit that became instinct - in the assumption that every sound you made was overheard, and, except in darkness, every movement scrutinised.
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. François Hollande, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. François made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and François, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. François turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the Party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.
|
||||
Outside, even through the shut window-pane, the world looked cold. Down in the street little eddies of wind were whirling dust and torn paper into spirals, and though the sun was shining and the sky a harsh blue, there seemed to be no colour in anything, except the posters that were plastered everywhere. The black-moustachio’d face gazed down from every commanding corner. There was one on the house-front immediately opposite. BIG BROTHER IS WATCHING YOU, the caption said, while the dark eyes looked deep into François’s own. Down at street level another poster, torn at one corner, flapped fitfully in the wind, alternately covering and uncovering the single word INGSOC. In the far distance a helicopter skimmed down between the roofs, hovered for an instant like a bluebottle, and darted away again with a curving flight. It was the police patrol, snooping into people's windows. The patrols did not matter, however. Only the Thought Police mattered. Behind François's back the voice from the telescreen was still babbling away about pig-iron and the overfulfilment of the Ninth Three-Year Plan. The telescreen received and transmitted simultaneously. Any sound that François made, above the level of a very low whisper, would be picked up by it; moreover, so long as he remained within the field of vision which the metal plaque commanded, he could be seen as well as heard. There was of course no way of knowing whether you were being watched at any given moment. How often, or on what system, the Thought Police plugged in on any individual wire was guesswork. It was even conceivable that they watched everybody all the time. But at any rate they could plug in your wire whenever they wanted to. You had to live - did live, from habit that became instinct - in the assumption that every sound you made was overheard, and, except in darkness, every movement scrutinised.
|
||||
Winston kept his back turned to the telescreen. It was safer; though, as he well knew, even a back can be revealing. A kilometre away the Ministry of Truth, his place of work, towered vast and white above the grimy landscape. This, he thought with a sort of vague distaste - this was London, chief city of Airstrip One, itself the third most populous of the provinces of Oceania. He tried to squeeze out some childhood memory that should tell him whether London had always been quite like this. Were there always these vistas of rotting nineteenth-century houses, their sides shored up with baulks of timber, their windows patched with cardboard and their roofs with corrugated iron, their crazy garden walls sagging in all directions? And the bombed sites where the plaster dust swirled in the air and the willowherb straggled over the heaps of rubble; and the places where the bombs had cleared a larger patch and there had sprung up sordid colonies of wooden dwellings like chicken-houses? But it was no use, he could not remember: nothing remained of his childhood except a series of bright-lit tableaux, occurring against no background and mostly unintelligible.
|
||||
|
||||
|
||||
Generated text
|
||||
---------------
|
||||
|
||||
Part I
|
||||
Chapter I
|
||||
|
||||
It was a bright cold day in April, and the clocks were striking thirteen. François Hollande, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him. The hallway smelt of boiled cabbage and old rag mats. At one end of it a coloured poster, too large for indoor display, had been tacked to the wall. It depicted simply an enormous face, more than a metre wide: the face of a man of about forty-five, with a heavy black moustache and ruggedly handsome features. François made for the stairs. It was no use trying the lift. Even at the best of times it was seldom working, and at present the electric current was cut off during daylight hours. It was part of the economy drive in preparation for Hate Week. The flat was seven flights up, and François, who was thirty-nine and had a varicose ulcer above his right ankle, went slowly, resting several times on the way. On each landing, opposite the lift shaft, the poster with the enormous face gazed from the wall. It was one of those pictures which are so contrived that the eyes follow you about when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran.
|
||||
Inside the flat a fruity voice was reading out a list of figures which had something to do with the production of pig-iron. The voice came from an oblong metal plaque like a dulled mirror which formed part of the surface of the right-hand wall. François turned a switch and the voice sank somewhat, though the words were still distinguishable. The instrument (the telescreen, it was called) could be dimmed, but there was no way of shutting it off completely. He moved over to the window: a smallish, frail figure, the meagreness of his body merely emphasized by the blue overalls which were the uniform of the Party. His hair was very fair, his face naturally sanguine, his skin roughened by coarse soap and blunt razor blades and the cold of the winter that had just ended.
|
||||
Outside, even through the shut window-pane, the world looked cold. Down in the street little eddies of wind were whirling dust and torn paper into spirals, and though the sun was shining and the sky a harsh blue, there seemed to be no colour in anything, except the posters that were plastered everywhere. The black-moustachio’d face gazed down from every commanding corner. There was one on the house-front immediately opposite. BIG BROTHER IS WATCHING YOU, the caption said, while the dark eyes looked deep into François’s own. Down at street level another poster, torn at one corner, flapped fitfully in the wind, alternately covering and uncovering the single word INGSOC. In the far distance a helicopter skimmed down between the roofs, hovered for an instant like a bluebottle, and darted away again with a curving flight. It was the police patrol, snooping into people's windows. The patrols did not matter, however. Only the Thought Police mattered. Behind François's back the voice from the telescreen was still babbling away about pig-iron and the overfulfilment of the Ninth Three-Year Plan. The telescreen received and transmitted simultaneously. Any sound that François made, above the level of a very low whisper, would be picked up by it; moreover, so long as he remained within the field of vision which the metal plaque commanded, he could be seen as well as heard. There was of course no way of knowing whether you were being watched at any given moment. How often, or on what system, the Thought Police plugged in on any individual wire was guesswork. It was even conceivable that they watched everybody all the time. But at any rate they could plug in your wire whenever they wanted to. You had to live - did live, from habit that became instinct - in the assumption that every sound you made was overheard, and, except in darkness, every movement scrutinised.
|
||||
François kept his back turned to the telescreen. It was safer; though, as he well knew, even a back can be revealing. A kilometre away the Ministry of Truth, his place of work, towered vast and white above the grimy landscape. This, he thought with a sort of vague distaste - this was London, chief city of Airstrip One, itself the third most populous of the provinces of Oceania. He tried to squeeze out some childhood memory that should tell him whether London had always been quite like this. Were there always these vistas of rotting nineteenth-century houses, their sides shored up with baulks of timber, their windows patched with cardboard and their roofs with corrugated iron, their crazy garden walls sagging in all directions? And the bombed sites where the plaster dust swirled in the air and the willowherb straggled over the heaps of rubble; and the places where the bombs had cleared a larger patch and there had sprung up sordid colonies of wooden dwellings like chicken-houses? But it was no use, he could not remember: nothing remained of his childhood except a series of bright-lit tableaux, occurring against no background and mostly unintelligible.
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
Source: George Orwell's 1984
|
||||
|
||||
|
||||
imperfectly
|
||||
perfect
|
||||
perfectly
|
||||
perfectly
|
||||
perfect
|
||||
perfectly
|
||||
perfectly
|
||||
perfect
|
||||
persecuting
|
||||
experience
|
||||
experienced
|
||||
perfectly
|
||||
perfectly
|
||||
experience
|
||||
permanence
|
||||
perfectly
|
||||
perfect
|
||||
perfectly
|
||||
persistence
|
||||
perfect
|
||||
perfectly
|
||||
perfectly
|
||||
persecutions
|
||||
persecuted
|
||||
persecutors
|
||||
perfect
|
||||
experience
|
||||
perfect
|
||||
persecution
|
||||
persecution
|
||||
perfectly
|
||||
perfectly
|
||||
perfection
|
||||
perfect
|
||||
perfected
|
||||
preference
|
||||
imperfectly
|
||||
@@ -0,0 +1,6 @@
|
||||
L'année 1866 fut marquée par un événement bizarre, un phénomène inexpliqué et inexplicable que personne n'a sans doute oublié. Sans
|
||||
parler des rumeurs qui agitaient les populations des ports et surexcitaient l'esprit public à l'intérieur des continents les gens de
|
||||
mer furent particulièrement émus. Les négociants, armateurs, capitaines de navires, skippers et masters de l'Europe et de l'Amérique, officiers
|
||||
des marines militaires de tous pays, et, après eux, les gouvernements des divers États des deux continents, se préoccupèrent de ce fait au
|
||||
plus haut point.
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
sentence="azerty uiop"
|
||||
words = sentence.split()
|
||||
print (words)
|
||||
for word in words:
|
||||
print(len(word))
|
||||
@@ -0,0 +1,7 @@
|
||||
Python est un langage de programmation puissant et facile à apprendre. Il dispose de structures de données de haut niveau et d’une approche de la programmation orientée objet simple mais efficace. Parce que sa syntaxe est élégante, que son typage est dynamique et qu’il est interprété, Python est un langage idéal pour l’écriture de scripts et le développement rapide d’applications dans de nombreux domaines et sur de nombreuses plateformes.
|
||||
L’interpréteur Python et sa vaste bibliothèque standard sont disponibles librement, sous forme de sources ou de binaires, pour toutes les plateformes majeures, depuis le site Internet http://www.python.org/ et peuvent être librement redistribués. Le même site distribue et contient des liens vers des modules, des programmes et des outils tiers ainsi que vers de la documentation supplémentaire.
|
||||
L’interpréteur Python peut être facilement étendu par de nouvelles fonctions et types de données implémentés en C ou C++ (ou tout autre langage appelable depuis le C). Python est également adapté comme langage d’extension pour personnaliser des applications.
|
||||
Ce tutoriel introduit au lecteur, de façon informelle, les concepts de base ainsi que les fonctionnalités du langage Python et de son écosystème. Il aide à prendre en main l’interpréteur Python pour une utilisation sur des cas pratiques. Les exemples étant indépendants, le tutoriel est adapté à une lecture hors ligne.
|
||||
Pour une description des objets et modules de la bibliothèque standard, voyez The Python Standard Library. The Python Language Reference présente une définition plus formelle du langage. Pour écrire des extensions en C ou en C++, lisez Extending and Embedding the Python Interpreter et Manuel de Référence de l’API Python/c. Des livres sont également disponibles qui couvrent Python dans le détail.
|
||||
L’ambition de ce tutoriel n’est pas d’être exhaustif et de couvrir chaque fonctionnalités, ni même toutes les fonctionnalités les plus utilisées. Il cherche, par contre, à introduire plusieurs des fonctionnalités les plus notables et à vous donner une bonne idée de la saveur et du style du langage. Après l’avoir lu, vous serez capable de lire et d’écrire des modules et des programmes Python et vous serez prêts à en apprendre d’avantage sur les modules de la bibliothèque Python décrits dans The Python Standard Library.
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
Les 120 enseignes de l'habillement trouvent un accord pour ouvrir le dimanche
|
||||
|
||||
Le travail du dimanche vient de franchir un pas de géant. La Fédération des enseignes de l'habillement vient de signer avec les partenaires sociaux du commerce succursaliste un accord social sur la dérogation au repos dominical dans la cadre de la loi Macron s'appliquant dans les zones touristiques internationales. Un cap décisif car il s'agit du plus important accord de branche autorisant le travail le dimanche signé à ce jour. Il concerne en effet plus de 120 enseignes, comme Kiabi, H&M, Celio ou Camaïeu, soit 22.000 points de vente et près de 120.000 salariés. Il a fallu plus d'un an à la fédération et aux organisations syndicales pour trouver un terrain d'entente. Pour les salariés qui se porteront volontaires, les parties ont validé le doublement de la rémunération des heures effectuées le dimanche. De plus, « le repos compensateur sera rémunéré pour les heures supplémentaires effectuées ce jour-là ", indique la Fédération des enseignes de l'habillement. Il sera possible pour ceux qui le veulent de revenir sur leur décision et de bénéficier d'un dimanche qui n'était pas prévu, « en cas d'indisponibilité ponctuelle ".
|
||||
Un impact favorable sur l'emploi
|
||||
Le plafond a été fixé à 26 dimanches travaillés par an, sauf si le salarié veut en faire plus. En échange, les enseignes se sont engagées à financer les frais de garde des enfants, et ce à hauteur de 40 euros maximum par dimanche travaillé. « Cet accord est une excellente nouvelle pour nos enseignes, qui traversent des moments difficiles depuis plusieurs années. Les magasins d'habillement, à l'instar des grands magasins, vont enfin pouvoir bénéficier de la clientèle dominicale », a indiqué Christian Pimont, le président de l'Alliance du commerce. Ces ouvertures devraient aussi avoir un impact favorable sur l'emploi. Les partenaires sociaux estiment que 850 postes seront maintenus grâce au chiffre d'affaires supplémentaire attendu du dimanche et 250 emplois nouveaux créés. Cet accord de branche est le quatrième signé en France dans le commerce concernant le travail dominical, après le bricolage (qui dispose d'une dérogation de plein droit, la couture parisienne et la bijouterie-joaillerie).
|
||||
Les échos.fr du 7/7/17
|
||||
@@ -0,0 +1 @@
|
||||
Je veux dire les formes changées en nouveaux corps. année
|
||||
@@ -0,0 +1 @@
|
||||
Pthn st n lngg d prgrmmtn pssnt t fcl à pprndr. Il dsps d strctrs d dnns d ht nv t d’n pprch d l prgrmmtn rnt bjt smpl ms ffcc. Prc q s sntx st lgnt, q sn tpg st dnmq t q’l st ntrprt, Pthn st n lngg dl pr l’crtr d scrpts t l dvlppmnt rpd d’pplctns dns d nmbrx dmns t sr d nmbrss pltfrms. L’ntrprtr Pthn t s vst bblthq stndrd snt dspnbls lbrmnt, ss frm d srcs d bnrs, pr tts ls pltfrms mjrs, dps l st Intrnt http://www.pthn.rg/ t pvnt tr lbrmnt rdstrbs. L mm st dstrb t cntnt ds lns vrs ds mdls, ds prgrmms t ds tls trs ns q vrs d l dcmnttn spplmntr. L’ntrprtr Pthn pt tr fclmnt tnd pr d nvlls fnctns t tps d dnns mplmnts n C C++ ( tt tr lngg pplbl dps l C). Pthn st glmnt dpt cmm lngg d’xtnsn pr prsnnlsr ds pplctns. C ttrl ntrdt lctr, d fçn nfrmll, ls cncpts d bs ns q ls fnctnnlts d lngg Pthn t d sn csstm. Il d à prndr n mn l’ntrprtr Pthn pr n tlstn sr ds cs prtqs. Ls xmpls tnt ndpndnts, l ttrl st dpt à n lctr hrs lgn. Pr n dscrptn ds bjts t mdls d l bblthq stndrd, vz Th Pthn Stndrd Lbrr. Th Pthn Lngg Rfrnc prsnt n dfntn pls frmll d lngg. Pr crr ds xtnsns n C n C++, lsz Extndng nd Embddng th Pthn Intrprtr t Mnl d Rfrnc d l’API Pthn/c. Ds lvrs snt glmnt dspnbls q cvrnt Pthn dns l dtl. L’mbtn d c ttrl n’st ps d’tr xhstf t d cvrr chq fnctnnlts, n mm tts ls fnctnnlts ls pls tlss. Il chrch, pr cntr, à ntrdr plsrs ds fnctnnlts ls pls ntbls t à vs dnnr n bnn d d l svr t d stl d lngg. Aprs l’vr l, vs srz cpbl d lr t d’crr ds mdls t ds prgrmms Pthn t vs srz prts à n pprndr d’vntg sr ls mdls d l bblthq Pthn dcrts dns Th Pthn Stndrd Lbrr.
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
sentence="azerty uiop"
|
||||
words = sentence.split()
|
||||
print (words)
|
||||
for word in words:
|
||||
print(word.index(word))
|
||||
@@ -0,0 +1 @@
|
||||
phrase sans les voyelles : Pthn st n lngg d prgrmmtn pssnt t fcl à pprndr. Il dsps d strctrs d dnns d ht nv t d’n pprch d l prgrmmtn rnt bjt smpl ms ffcc. Prc q s sntx st lgnt, q sn tpg st dnmq t q’l st ntrprt, Pthn st n lngg dl pr l’crtr d scrpts t l dvlppmnt rpd d’pplctns dns d nmbrx dmns t sr d nmbrss pltfrms. L’ntrprtr Pthn t s vst bblthq stndrd snt dspnbls lbrmnt, ss frm d srcs d bnrs, pr tts ls pltfrms mjrs, dps l st Intrnt http://www.pthn.rg/ t pvnt tr lbrmnt rdstrbs. L mm st dstrb t cntnt ds lns vrs ds mdls, ds prgrmms t ds tls trs ns q vrs d l dcmnttn spplmntr. L’ntrprtr Pthn pt tr fclmnt tnd pr d nvlls fnctns t tps d dnns mplmnts n C C++ ( tt tr lngg pplbl dps l C). Pthn st glmnt dpt cmm lngg d’xtnsn pr prsnnlsr ds pplctns. C ttrl ntrdt lctr, d fçn nfrmll, ls cncpts d bs ns q ls fnctnnlts d lngg Pthn t d sn csstm. Il d à prndr n mn l’ntrprtr Pthn pr n tlstn sr ds cs prtqs. Ls xmpls tnt ndpndnts, l ttrl st dpt à n lctr hrs lgn. Pr n dscrptn ds bjts t mdls d l bblthq stndrd, vz Th Pthn Stndrd Lbrr. Th Pthn Lngg Rfrnc prsnt n dfntn pls frmll d lngg. Pr crr ds xtnsns n C n C++, lsz Extndng nd Embddng th Pthn Intrprtr t Mnl d Rfrnc d l’API Pthn/c. Ds lvrs snt glmnt dspnbls q cvrnt Pthn dns l dtl. L’mbtn d c ttrl n’st ps d’tr xhstf t d cvrr chq fnctnnlts, n mm tts ls fnctnnlts ls pls tlss. Il chrch, pr cntr, à ntrdr plsrs ds fnctnnlts ls pls ntbls t à vs dnnr n bnn d d l svr t d stl d lngg. Aprs l’vr l, vs srz cpbl d lr t d’crr ds mdls t ds prgrmms Pthn t vs srz prts à n pprndr d’vntg sr ls mdls d l bblthq Pthn dcrts dns Th Pthn Stndrd Lbrr.
|
||||
@@ -0,0 +1,7 @@
|
||||
# déclarer les variables
|
||||
lettre1 = "o"
|
||||
lettre2 = "l"
|
||||
lettre3 = "a"
|
||||
# imprimer les variables
|
||||
print(lettre1+lettre2+lettre3)
|
||||
# print(lettre1,lettre2,lettre3)
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
#déclare la variable sentence comme une chaîne de caractères
|
||||
sentence = "Derniers jours avant noel. -50% sur tout le magasin. Consonnez SVP!"
|
||||
print("phrase de départ :",sentence)
|
||||
|
||||
#converti sentence en liste appelée words
|
||||
words = sentence.split()
|
||||
#print(words)
|
||||
|
||||
# define new word as list
|
||||
new_word = []
|
||||
|
||||
#retirer les a, e, i, o, u et y de chaque mot
|
||||
for word in words:
|
||||
word=word.replace("a","")
|
||||
word=word.replace("e","")
|
||||
word=word.replace("é","")
|
||||
word=word.replace("i","")
|
||||
word=word.replace("o","")
|
||||
word=word.replace("u","")
|
||||
word=word.replace("y","")
|
||||
#print(word)
|
||||
# add word to new word list
|
||||
new_word.append(word)
|
||||
|
||||
#recomposer la phrase sans les voyelles
|
||||
print("phrase sans les voyelles :", " ".join(new_word))
|
||||
with open("phrase.txt","w") as destination:
|
||||
destination.write("phrase sans les voyelles :")
|
||||
destination.write(" ".join(new_word))
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# définir new_word comme une liste
|
||||
new_word = []
|
||||
|
||||
with open("entree.txt","r") as source: #ouvre un fichier texte pour le lire pour read, on l'appelle source
|
||||
for line in source: #pour chaque ligne de source…
|
||||
words = line.split() #converti sentence en liste appelée words
|
||||
for word in words: #pour chaque mot remplacer…
|
||||
word=word.replace("a","")
|
||||
word=word.replace("e","")
|
||||
word=word.replace("ë","")
|
||||
word=word.replace("i","")
|
||||
word=word.replace("o","")
|
||||
word=word.replace("u","")
|
||||
word=word.replace("y","")
|
||||
new_word.append(word) #ajoute chaque mot dans la liste new word
|
||||
|
||||
print(" ".join(new_word)) #recomposer la phrase d'après la liste new_word
|
||||
with open("phrase.txt","w") as destination: #ouvre ou crée un fichier phrase.txt et remplace ou crée le texte destination (w) pour write
|
||||
# destination.write("phrase sans les voyelles :")
|
||||
destination.write(" ".join(new_word))
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
#ce script permet d'ouvrir un fichier texte, de supprimer les voyelles et d'enregistrer le nouveau texte dans le fichier phrase.txt
|
||||
|
||||
#défini la liste des voyelles
|
||||
list_voyelles=["a", "e", "é", "è", "ë", "ê", "i", "ï", "o", "u", "ù", "y"]
|
||||
|
||||
# définir "new_word" comme une liste
|
||||
new_words = []
|
||||
|
||||
with open("entree.txt","r") as source: #ouvre un fichier texte pour le lire (r) pour read, on l'appelle "source"
|
||||
for line in source: #pour chaque ligne de "source"…
|
||||
words = line.split() #découpe les lignes en mots mis dans la liste "words"
|
||||
for word in words: #pour chaque mot "word" de la liste "words"
|
||||
for v in list_voyelles: #pour chaque caractère v de la list_voyelles
|
||||
word = word.replace(v,"") #remplacer v par rien, dans word
|
||||
new_words.append(word) #remettre chaque "word" dans la liste new_words
|
||||
|
||||
print("phrase sans les voyelles :", " ".join(new_words)) #recomposer la phrase d'après la liste new_words
|
||||
with open("phrase.txt","w") as destination: #ouvre ou crée un fichier phrase.txt et remplace ou crée le texte destination (w) pour write
|
||||
destination.write(" ".join(new_words)) #recomposer la phrase d'après la liste new_words et écrire le texte dans "destination"
|
||||
Reference in New Issue
Block a user