-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindspaces.py
More file actions
110 lines (79 loc) · 4.32 KB
/
findspaces.py
File metadata and controls
110 lines (79 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 28 00:48:07 2020
@author: rcxsm
"""
import collections
from collections import Counter
def left(s, amount):
return s[:amount]
def right(s, amount):
return s[-amount:]
def mid(s, offset, amount):
return s[offset:offset+amount]
def Sorting(lst):
lst2 = sorted(lst, key=len, reverse=True)
print ("gesorteerd")
return lst2
def most_frequent(List):
occurence_count = Counter(List)
return occurence_count.most_common(1)[0][0]
document = "meditation.txt"
textold = "dropthemosttempleoftemperatureofImakemistakestheEnglishword,droptheinnermosttempleoftemperaturegod,Imakemistakes,offerasknowledge,peacewithin.Ifyouarebeautiful.That'stotallyfine-sixoutnineoutnineeightandcomeintohispresence,ithadadistractionorburdensthatonemorepeacefullifemindinghispresence.Soiftheresomeotherstrongemotionsthatyou'redoingthisabilitytotheshoulderblades,thebreath.Angerislight,letyourwholebodyrecognizetheabilitytothetoesmove.TherhythmandequanimousmindapeacefulandIhavetheseareas.Thatisyourmindisgonnasound,touch,smellstastes,visionsandeverydaytodayyouletthestillnessforthesoftpalate,thebreathandhavereceivedandhonestlyandCenterthequestionaboutaboutyourself,thenhowcandoyourfreefromexternalnoisetherearestrong,youarebeingunhappyorgoofequanimityisconstantlyin-threeyearsofthoughtsthatasthoughyounoticethereisneverhearorGod.Doesn'titreallyunhappy,reallyimportanttobeok.Thankyou.Sometimeswecouldthinkofallbeingsofthingswithanyseedsofpain.Youcannotchangeofyouneedtorunawayfromassigninganyseedsofyourmindfocusedininwerecordedthechannelofthismeditation.Ihopeyoucanbeaquestionthattheyareseedeeplydownintotheinnerawarenessremaincalmandalongyourbody.Inthebeautifulexperiencethemindonearth-eightin-sixphasefourinthebreathasameditationit'snoisythingshappeningthroughouttimeyouknow,Iwearthem,letexhalationeachtime.Fascinatedagain,thereanyonelikeyouandknowingnessthatpersoninourfeelings,butwhenyoumightbeplaysureit'snoisysurroundings,badinthesameseated,poseandobserveitmoreenergyformyvoiceofpeacewithlove.Gentlyallowyourselfconnectedwithrealitysimplyobservethefeelingofwhoyoumindandallowthesolesoftrainingthenexttwointhesixinmindsteadilymakesitselfaround.Youmaynoticethereismuchformyownskin,astheheart,intothebreathsbackwardsfromthemindsisokay.Let'sseesomethingbigstorm,butwithadreadfulwayofthesternumdeeponthepurityandrestandbodyclearthechestsandbegincountingfromthestillness.I'mgonnasaytheheartandyourfieldoftiredness.Youmayalldownattheheartupmentallytellthemtocomeback.Noticetherhythm,theheart.Askyourselfgivingyourwholeworld.Whenyou'regoingonaniceandthenaskinthreein-sixphaseispermanentbridgetotheankles,thepathisalwaysthinkthey'rebeautiful,youtocultivate,what'sreallyupsetandyouknowitwaslookingforourlivesinsidethesignifierofthebreathnaturallyunfoldinginthis"
trump = open(document, encoding='utf8').read()
#corpus = ['drop', 'most']
corpus = trump.split()
corpus3= Sorting(corpus)
#print (corpus3)
print (len(corpus))
numberofwords=0
textnw = "# "
a=0
b=0
#print (corpus)
found = False
gevonden = []
def find_word (textold):
global a, b, found, textnw, gevonden, i, x
for i in corpus3:
x = len(i)
y = len (textold)
if x > 3 :
if left(textold,x) == i:
#print (i)
gevonden.append(i)
found = True
#print (gevonden)
#print (i)
if found == True:
chooseword(textold)
else:
cut_letter(textold)
#find_word(textold)
def chooseword(textold):
global a, b, found, textnw, gevonden, i, x, numberofwords
foundword= most_frequent(gevonden)
y = len(foundword)
#print (gevonden)
textnw = "X" + foundword + " " + i
#print (textnw)
#print ("*")
z = y-x
textold = right (textold, z)
print (f"I chose {foundword}")
found = True
numberofwords+=1
if numberofwords <4 :
find_word(textold)
def cut_letter(textold):
global a, b, found, textnw, gevonden, i, x
z = (len(textold)-1)
cutoff =left(textold,1)
print (cutoff)
textold = right(textold, z)
find_word(textold)
find_word(textold)
print (textold)
print (textnw)
##index = corpus3.index('inner')
#print('The index of disney+ is:', index)