Skip to content

Commit ee994dd

Browse files
committed
add 0006
1 parent c4d9751 commit ee994dd

File tree

8 files changed

+401
-30
lines changed

8 files changed

+401
-30
lines changed

llluiop/.idea/workspace.xml

Lines changed: 221 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

llluiop/0006/MostWords.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
5+
6+
def DiaryFiles(path):
7+
if os.path.exists(path):
8+
for file in os.listdir(path):
9+
if 'diary' in file:
10+
yield os.path.join(path, file)
11+
12+
def CalcWords(file, dict1):
13+
f = open(file)
14+
for line in f.readlines():
15+
for word in line.split():
16+
if word in dict1.keys():
17+
dict1[word] += 1
18+
else:
19+
dict1[word] = 1
20+
21+
def Words(path):
22+
dict1 = {}
23+
for file in DiaryFiles(path):
24+
CalcWords(file, dict1)
25+
26+
maxvalue = max(dict1.values())
27+
28+
for key in dict1:
29+
if dict1[key] == maxvalue:
30+
print key,':', maxvalue
31+
32+
33+
34+
if __name__ == '__main__':
35+
Words('diary')
36+

llluiop/0006/diary/diary.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Shape of my heart
2+
3+
He deals the cards as a meditation
4+
And those he plays never suspect
5+
He doesn't play for the money he wins
6+
He doesn't play for respect
7+
He deals the crads to find the answer
8+
The sacred geometry of chance
9+
The hidden loaw of a probable outcome
10+
The numbers lead a dance
11+
12+
I know that the spades are swords of a soldier
13+
I know that the clubs are weapons of war
14+
I know that diamonds mean money for this art
15+
But that's not the shape of my heart
16+
He may play the jack of diamonds
17+
He may lay the queen of spades
18+
He may conceal a king in his hand
19+
While the memory of it fades
20+
21+
I know that the spades are swords of a soldier
22+
I know that the clubs are weapons of war
23+
I know that diamonds mean money for this art
24+
But that's not the shape of my heart
25+
26+
And if I told you that I loved you
27+
You'd maybe think there's something wrong
28+
I'm not a man of too many faces
29+
The mask I wear is one
30+
Those who speak know nothing
31+
And find out to their cost
32+
Like those who curse their luck in too many places
33+
And those who fear are lost
34+
35+
I know that the spades are swords of a soldier
36+
I know that the clubs are weapons of war
37+
I know that diamonds mean money for this art
38+
But that's not the shape of my heart

llluiop/0006/diary/diary1.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Shape of my heart
2+
3+


llluiop/0006/diary/diary2.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Shape of my heart
2+
3+
He deals the cards as a meditation
4+
And those he plays never suspect
5+
He doesn't play for the money he wins
6+
He doesn't play for respect
7+
He deals the crads to find the answer
8+
The sacred geometry of chance
9+
The hidden loaw of a probable outcome
10+
The numbers lead a dance
11+

llluiop/0006/diary/diary3.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Shape of my heart
2+
3+
He deals the cards as a meditation
4+
And those he plays never suspect
5+
He doesn't play for the money he wins
6+
He doesn't play for respect
7+
He deals the crads to find the answer
8+
The sacred geometry of chance
9+
The hidden loaw of a probable outcome
10+
The numbers lead a dance
11+
12+
I know that the spades are swords of a soldier
13+
I know that the clubs are weapons of war
14+
I know that diamonds mean money for this art
15+
But that's not the shape of my heart
16+
He may play the jack of diamonds
17+
He may lay the queen of spades
18+
He may conceal a king in his hand
19+
While the memory of it fades
20+

llluiop/0006/diary/diary4.txt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Shape of my heart
2+
3+
He deals the cards as a meditation
4+
And those he plays never suspect
5+
He doesn't play for the money he wins
6+
He doesn't play for respect
7+
He deals the crads to find the answer
8+
The sacred geometry of chance
9+
The hidden loaw of a probable outcome
10+
The numbers lead a dance
11+
12+
I know that the spades are swords of a soldier
13+
I know that the clubs are weapons of war
14+
I know that diamonds mean money for this art
15+
But that's not the shape of my heart
16+
He may play the jack of diamonds
17+
He may lay the queen of spades
18+
He may conceal a king in his hand
19+
While the memory of it fades
20+
21+
I know that the spades are swords of a soldier
22+
I know that the clubs are weapons of war
23+
I know that diamonds mean money for this art
24+
But that's not the shape of my heart
25+
26+
And if I told you that I loved you
27+
You'd maybe think there's something wrong
28+
I'm not a man of too many faces
29+
The mask I wear is one
30+
Those who speak know nothing
31+
And find out to their cost
32+
Like those who curse their luck in too many places
33+
And those who fear are lost
34+

llluiop/0006/diary/diary5.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Shape of my heart
2+
3+
He deals the cards as a meditation
4+
And those he plays never suspect
5+
He doesn't play for the money he wins
6+
He doesn't play for respect
7+
He deals the crads to find the answer
8+
The sacred geometry of chance
9+
The hidden loaw of a probable outcome
10+
The numbers lead a dance
11+
12+
I know that the spades are swords of a soldier
13+
I know that the clubs are weapons of war
14+
I know that diamonds mean money for this art
15+
But that's not the shape of my heart
16+
He may play the jack of diamonds
17+
He may lay the queen of spades
18+
He may conceal a king in his hand
19+
While the memory of it fades
20+
21+
I know that the spades are swords of a soldier
22+
I know that the clubs are weapons of war
23+
I know that diamonds mean money for this art
24+
But that's not the shape of my heart
25+
26+
And if I told you that I loved you
27+
You'd maybe think there's something wrong
28+
I'm not a man of too many faces
29+
The mask I wear is one
30+
Those who speak know nothing
31+
And find out to their cost
32+
Like those who curse their luck in too many places
33+
And those who fear are lost
34+
35+
I know that the spades are swords of a soldier
36+
I know that the clubs are weapons of war
37+
I know that diamonds mean money for this art
38+
But that's not the shape of my heart

0 commit comments

Comments
 (0)