Home | Community | Message Board

Cannabis Seeds Zamnesia
This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Shop: North Spore Bulk Substrate   Kraken Kratom Red Vein Kratom   PhytoExtractum Buy Bali Kratom Powder   Original Sensible Seeds Autoflowering Cannabis Seeds   Unfolding Nature Unfolding Nature: Being in the Implicate Order

Jump to first unread post Pages: < Back | 1 | 2  [ show all ]
Onlinegopher
Coffee Bean Extraordinaire
I'm a teapot


Registered: 11/22/17
Posts: 13,170
Loc: Canada Flag
Last seen: 2 minutes, 33 seconds
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26276314 - 10/25/19 01:22 PM (4 years, 3 months ago)

Im not seeing where you import your source text in your code?

edit

words = "".join(stdin.readlines()).split()

are you literally typing them into your terminal?


--------------------
For most of the normies out there, an operating system is just a bootloader for Google Chrome.

Since Disney has obtained tremendous value from the public domain, knows how important the public domain is, and is firmly determined to never contribute anything to it.

My pronouns are He and Him, and my adjectives are Fat and Jazzy

:kratom:


Edited by gopher (10/25/19 01:23 PM)


Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: gopher]
    #26276372 - 10/25/19 01:43 PM (4 years, 3 months ago)

Sorry yeah put all that into a text file (e.g. markov.py) and save. You can either run it like this:

python3 markov.py 200 < input.txt

Or you can make the file directly executable with chmod. (the "#!/usr/bin/python3" in the first line of the earlier code is what makes this work.)

chmod u+x markov.py
./markov.py 200 < input.txt

Edit: misread what you were asking, you may already know that stuff about chmod. But yeah it reads the words from stdin.


Edited by psi (10/25/19 01:51 PM)


Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26276486 - 10/25/19 02:49 PM (4 years, 3 months ago)

Having a program just read from stdin and write to stdout lets you slap together something quick and then use pipes and redirection to add other functionality with reading from files and whatever. E.g. concatinating multiple input files with cat and piping the output of that to the program:

cat file1 file2 file3 | ./markov.py 200

I was trying to mix Sherlock Holmes and Shakespeare but the Shakespeare was drowning everything out, so I repeated the Sherlock more times to balance out the probabilities.

Quote:

cat cano.txt cano.txt t8.shakespeare.txt | ./markov.py 300
Acts little Jack, I smiled with all rhyme nor these, Her sufferings were driving your Majesty, my fair lords! SECOND MURDERER. Here is a light them before I can that strange cases, his guard. It is a look upon me where I piece of Don Pedro, was a traitor Stands in the colonies in touch. Picture of the discharge. Your noble son, so do it in the centre was in every turn. Come we return it was not known The vocabulary of course, you can find myself for yourself; Your name of one's hopes of troubling you, take her golden tunnels of incomplete, inaccurate or you, Mr. James Blunt, Falstaff. Here come the Tollers opened at this, do not the front of the Alpha." "Well done! Answer, as this day of March (Who is, as you will avouch't in your honour. HASTINGS. So shalt know the utmost. Mr. Roundhay, the ham and down by the impossible to my honesty, but in's presence, she that we are two human nature plead- QUINTUS. Father, and full low, heavily-lintelled door, I have been lounging upon my word which I cannot see. You have you?" "It is sad, Say 'Katharine Queen of the prisoner, And here, man," said he. 'What shall know him So indeed the "The Channel," "Rosythe," and throes of it. But neither police some information from which of it. For many years that he does Hamlet? Ham. Come on, away. My love you, for a thrill of death. We will he still carrying lanterns, and Men. It's a cigar too," cried Frankland, of Baron looked hard heart is so," said to be an air-gun. All the more difficult to my mind me. That's villanous company, I need Speaks to the subjects Are not have him! I ventured to die for sorrow




Quote:

cat cano.txt cano.txt cano.txt t8.shakespeare.txt | ./markov.py 300

flog them has done tonight with you thought little reed-girt sheet of our visitor. I got his unclean gods. SICINIUS. This is nothing could have serv'd me as much," said the counterfoil of their loyalties; wherein, to argue that he is always ready to th' Senate, I'll be it, poor suitors press it to New Jersey in South American shotgun," White Mason. You may add then, I have hurt a photograph at last night. Good shepherd, in the box which was utterly incredible how it up until we were just as Satan? ANTIPHOLUS OF SURREY, LORD ABERGAVENNY LORD with a small fragment of France; he was instantly slammed off thine not the numerous and purchas'd by Garcia looked at the door of old white-haired gentleman with the coroner's jury brought up from that I was soon have strong that the window. Then there on my host of the bravest or any noise came upon his appearance was outrun By the rock, As thus: Dear Isabel, I think it safer? If you have ever found out of giving me to keep the Earl of a shock to fall. I looked thoughtful. You stubborn spirits over with Lord of the spot where our room. "It's a cane-backed chair I can hold it in oath of primy nature, while the haggard and another theory which would be some foreign notepaper. I left in some days Rachel Howells or remark in four suits of me, I remarked. "'L'homme c'est rien--l'oeuvre c'est tout,' as I went after it. Had been a careful handling, Watson. But certain night 'To Mercury.' 'To seek for whatever luggage when I had several practical good night! Sleep for me hear that his trouser pocket. What we nearly every feather which your father was the influence with thy grace; that is




Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26276864 - 10/25/19 06:52 PM (4 years, 3 months ago)

I changed the line "words = "".join(stdin.readlines()).split()" to "words = "".join(stdin.readlines()).split(" ")" so it splits on just spaces instead of all whitespace. That way the formatting looks similar to the input text.

Some TNG nonsense:
Quote:

Ready room, Data is at Earth. Our Medical Officer hasn't been compromised.
PICARD: Any word from Starfleet headquarters and the patient. Captain.

[Ante room]

CRUSHER [OC]: He doesn't believe I wouldn't have you have found just that.
(He puts a second, but I would have no other choice. I must have a nice swim.
DATA: You are en route to join me, Jean-Luc, where temperatures reach up an exotic one of some greeting, old friend.
KEEL: Tell me, in to Starfleet Command lately? Anything unusual?
PICARD: No. I get the Federation. I have an aphorism, Starfleet's top command people being changed?
KEEL: I have seen strange patterns emerging. Unusual orders. High-ranking officials backing irrational proposals.
RIXX: Starbase twelve was completely evacuated for a particular set of facts. Or so far. Sensors beginning to the readout on ceremony here.
(The bowl in the parasites looks like to pick up for you. One can cause stress and shoots the details. Can you were really not detecting three hours fourteen minutes, sir.
RIKER: Increase to be no facts. Or sometimes brought about Starfleet. About something is served.
AARON: Wonderful. Bantering with us, covertly. This could snap your tour, Admiral?
QUINN: Quite extraordinary, in paranoid delusions for one as he's perfectly normal, but a special meal in Starfleet Command lately? Anything unusual?
PICARD: No. I am now receiving a while, Jean-Luc.
PICARD: Of course. We are en route to back of our mission is not him, but I have to Earth?
PICARD: I led you made Captain Rixx.
PICARD: I was a look.
RIKER: I want to wait.
PICARD: Let's have a terrible loss of elderly Admirals are approaching Dytallix B. We'll be joining us for you suggesting that why not? We're expected at this frequency?
KEEL [on monitor]: It usually in their way through talk of six planets mined for your gracious offer.
SAVAR [on viewscreen]: Of course. We accept your neck in person,



Quote:


needs, you again, Commander.
PICARD: I could be one of Quinn's neck)
CRUSHER: What have had frequent contact with two hours fourteen minutes, sir.
RIKER: Increase to disobey Starfleet Command, Data?
DATA: Three, sir. Sector sixty three.
PICARD: Specify. What do eat up, Picard. We'd be going on?
KEEL: Captain Rixx commanding.
DATA: The man picked me nothing but they are aware, Counsellor, that we seem to eat up, Picard. I led you would have seen him.
PICARD: Friendship must have to the Bridge.
WORF: Doctor?
CRUSHER: It's good to our arriving ahead of course, Captain. We didn't believe what about what's going to stimulate the threat.
PICARD: What threat?
TRYLA: Have you and scuttles under control, please report to hear what appears to warp factor eight.
LAFORGE: Aye sir. Starfleet is beginning. Don't you keep your neck in the Horatio was in your honour.
PICARD: Delightful. Tell me, why not? We're not know he's still one knows about that?
QUINN: Oh, for you. One can imagine you want you to Riker.
CRUSHER [OC]: Captain, I'm on the same. Have you and hit his arm with him, that why not? We're not Gregory Quinn. It would have seen him.
PICARD: Friendship must have no harm. We had a woman appear, also armed)
KEEL: Thanks for the dark about to be no one mark four.
(After a science station)
DATA: I felt it was attacked by the Federation by a data disc into a nearby Mira system.
PICARD: Mister Worf?
WORF: Swimming is served.
AARON: Wonderful. Bantering with fellow officers unless deemed absolutely necessary. There will be seeing you, Admiral. Enterprise rushes off on final approach)
DATA: Captain. We'll greet you told me about them, isn't him.
RIKER: Are there may be one of theatre. And there alone, unarmed?
PICARD: I'll summon my Executive Officer hasn't been totally destroyed.

Captain's personal favour. I'm afraid, but it was simply talking to have to be on the command people are you already in his head.
LAFORGE: This is Quinn.
LAFORGE: How are put away)
RIXX: Apologies, Captain. We are of these years are in the eye and fine beaches that be? The Horatio.
(Picard does like him a useless ball of weighing information before reaching a full well being of rock, a conclusion. Or, as humans? I have you be visible on our mission is the Captain Scott.
PICARD: Tryla Scott, and is expected at this is or logs mentioning any of the problems involved in zero gravity environment, coupled with him, but not overjoyed to make Pacifica a lifeless hunk of vague talk of some greeting, old friend. Why hasn't been really is getting down the Dytallix B.
PICARD: When?
KEEL [on monitor]: It is very forced)
RIKER: What is that?
(A pointed something is very one-sided fight - Quinn floors him either.
PICARD: Walker!
TRYLA: We had frequent contact with record of the emergency communiqué. It was a powerful impact on Earth.
QUINN: I suppose.
AARON: That's outstanding.
PICARD: Yes, Number One. What is in fact.
COMPUTER: Directions unclear. Please repeat request.
DATA: That pillow cum bolster looks him and the alien inside what it will be certain.
DATA: Perhaps we look around the purpose of Quinn's neck)
CRUSHER: What an exotic one knows about that?
QUINN:





Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26277074 - 10/25/19 09:30 PM (4 years, 3 months ago)

Here is something to get transcripts for every tng episode. I wanted to try to do a markov chain thing tailored to this formatting so that it treats each character separately etc.

Code:
#!/bin/bash
mkdir -p tng
for N in `seq 101 277`
do
lynx --dump "http://www.chakoteya.net/NextGen/${N}.htm" | sed -n '/Back to the episode listing/q;p' > tng/${N}.txt
done
rm tng/102.txt



Extras: Filter Print Post Top
Onlinegopher
Coffee Bean Extraordinaire
I'm a teapot


Registered: 11/22/17
Posts: 13,170
Loc: Canada Flag
Last seen: 2 minutes, 33 seconds
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26277643 - 10/26/19 07:43 AM (4 years, 3 months ago)

Quote:

sed -n '/Back to the episode listing/q;p'





I never heard of sed before what exactly are you doing there, I see -n means no printing q is quit and p is print, im kinda confused

https://www.grymoire.com/Unix/Sed.html#uh-15


--------------------
For most of the normies out there, an operating system is just a bootloader for Google Chrome.

Since Disney has obtained tremendous value from the public domain, knows how important the public domain is, and is firmly determined to never contribute anything to it.

My pronouns are He and Him, and my adjectives are Fat and Jazzy

:kratom:


Extras: Filter Print Post Top
OfflineKronikism
Mixing paint
I'm a teapot

Registered: 09/04/19
Posts: 135
Last seen: 3 years, 10 months
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: gopher]
    #26277666 - 10/26/19 07:51 AM (4 years, 3 months ago)

Maybe I'm just out of the loop but what's the point?do people really read that stuff,I read the first one cuz I didn't know what it was but like,isn't there better things to do...


Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: gopher]
    #26277854 - 10/26/19 09:36 AM (4 years, 3 months ago)

Quote:

gopher said:
Quote:

sed -n '/Back to the episode listing/q;p'





I never heard of sed before what exactly are you doing there, I see -n means no printing q is quit and p is print, im kinda confused

https://www.grymoire.com/Unix/Sed.html#uh-15



I'm not good with sed aside from just the basics, I adapted that from something on Stack Overflow. My understanding is that by default matching lines are printed and non-matches are not. So the -n makes it not print the line that contains "Back to the episode listing", the q makes it quit when it finds it (to discard the lines after) and the p makes it print if it hasn't quit from finding a match.

https://stackoverflow.com/questions/5227295/how-do-i-delete-all-lines-in-a-file-starting-from-after-a-matching-line


Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: Kronikism]
    #26277876 - 10/26/19 09:50 AM (4 years, 3 months ago)

Quote:

Kronikism said:
Maybe I'm just out of the loop but what's the point?do people really read that stuff,I read the first one cuz I didn't know what it was but like,isn't there better things to do...



It's just fun to mess around with. Sometimes it comes out with things that kind of make sense. It's kind of a rudimentary AI. And if you are writing the program to do it then you can try to improve on it and make it come up with more convincing stuff.


Extras: Filter Print Post Top
Invisible1234go
Ban Lotto Champion
 User Gallery

Registered: 07/08/09
Posts: 54,382
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi] * 2
    #26277925 - 10/26/19 10:14 AM (4 years, 3 months ago)



Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: 1234go]
    #26279080 - 10/26/19 06:52 PM (4 years, 3 months ago)

Quote:

Captain's log, stardate 42679.2. While there are manacled and swirly thing that spawns the hearings.

Captain's log, Stardate 43462.5. We have decided we have arrived at the twentieth century Earth.

Captain's log, stardate 46193.8. We have the Maquis will be uninhabited, we go to correct a mapping survey of people just as

Captain's log, Stardate 42194.7. It is the Romulan

Captain's log, supplemental. We have less than apprehensive to contact with his visor as Worf

Captain's log, stardate 47169.2. Security Officer reporting. We are not

Captain's log, supplemental. Our situation isn't dressed

Captain's log, stardate 44002.3. Repairs are chirping. The Loss

Captain's log, stardate 42625.4, We're en route to proceed to Starbase four one child, a solution. Their deliberate show that chatters

Captain's log, stardate 45854.2. The unexplained forcefield vanishes and there on clarinet,

Captain's log, supplemental. An experience like five planetary orbit while Suzanna wanders around. The turbolift doors open for a door which has reached Ventax Two have decided to come.

Captain's log, stardate 44805.3. My orders are proceeding on impulse power.

Captain's log, Stardate 41235.6. I knew what happens to

Captain's log, stardate 45470.1. The Measure Of Honour

Captain's log, stardate 43198.7. The Loud As feared, our journey past the explanation, it in London, I are a delegation of other colonists. Beginning with a few moments before he pulls her no sign of a piece of the Traveller makes Vash and are watching

Captain's log, supplemental. There is trying to Federation and no sign of Duras to our encounter with a small devices to normal part 1 goes hand-to-hand

Captain's log, stardate 45245.8. The klingon gets in half,

Captain's log, supplemental. The second one of Ullians to find an unusually lovely. My orders are running around, Jake on board to begin loading the Lorenze Cluster and is jumped by a cloaked and leaves Tryla Scott so he is proving more than himself, as they emerge from the performance of money,

Captain's log, stardate 45430.9. Counsellor Troi's head and stands aside

Captain's log, stardate 47423.9. We are beamed out. O'Brien shoots

Captain's log, stardate 45620.4. In uniform, which dissolve into a pink-skinned Bolian with Wesley, who has returned to cut out from drinking beverages

Captain's log, stardate 44162.8. At the bulkhead to

Captain's log, Stardate 42976.1. During a short in Data are about this time, Worf's phaser fly energy source of whom - a shipment to a noise, almost nothing there is leading an away team

Captain's log, supplemental. Captain Endar's claim that chimes when

Captain's log, stardate 46982.1. Because Engineering section has gone wrong aboard so that the J'naii are downloading the science log, supplemental. We have arrived at Penthara Four, an aria, and the Rana star into his hand with candles and

Captain's log, supplemental. We have regenerated themselves

Captain's log, supplemental. We have rendezvoused with a side passage and the back inside of returning to examine Farpoint, a bit of a jewel of the inner office briefly turns the backs on our examination of the door is 'Let's Get Away From the eighth planet surface, Commander Data. I am unable to the Coalition of the

Captain's log, Stardate 43957.2. We are wearing a brief but it with us toward planet Aldea, which has informed that whatever reasonable and stands

Captain's Log, stardate 43808.2. A horse-drawn carriage goes over the territory following the saucer section. so scared I find the pillow, gets shot of his long-term memory.

Captain's log, supplemental. This time, Beverly is sitting alone, we did not watching them. So it out successfully, but

Captain's log, stardate 46271.5. The turbolift is a thumping at

Captain's Log, Stardate 46041.1. We are in the Holodeck has assured of the shuttle's onboard computer.

Captain's log, stardate 47169.2. Security Officer remains concealed in anger

Captain's log, stardate 46315.5. The top of singing stone in exo-biology, but no further detail the Enterprise turns into orbit of transformation apparently taken a laser beams. It scans something into a tool. He

Captain's log, Commander Riker pushes Riker gets hit by the plants to engage in mid air, lying on the future. Six where the DNA has rejoined the comm. badge. Worf and Worf pushes it with the stranger only hope their cloaking shields, and fires. The Lieutenant Uhnari are safe in front of several seconds too briefly, I can't keep pace with a big nasty version of Cardassian shoots at the two guards grab the tunnels, and Lieutenant Commander Data. I am still





Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26279104 - 10/26/19 07:12 PM (4 years, 3 months ago)

Quote:

Captain's log, stardate 41463.9. While Beverly gets to an Elizabethan era uniform and phaser and Deanna and Deanna enters to further indications of NCC1701 on the Klingon home weary and white facial hair, and Alexander starts tapping at Angosia Three, where (the first century detective who claims to one one of people just lounging about. Some of a rather solid-looking with some proper family is hanging nose with the Traveller vanishes and is passing Klingon vessel, she starts pushing buttons on (There's a different one, removes the exocomp to his visor as (a toolbox is one cancels the drum rolls over her hair when Worf by a jug of this unexplored dark hair, a phenomenon not based merely on the floor)




Extras: Filter Print Post Top
OfflineKronikism
Mixing paint
I'm a teapot

Registered: 09/04/19
Posts: 135
Last seen: 3 years, 10 months
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: psi]
    #26279213 - 10/26/19 08:48 PM (4 years, 3 months ago)

Yeah if I was high as fuck this stuff could be entertaining  maybe try a ghost story and someone's account at at an amusement park?


Extras: Filter Print Post Top
Invisiblepsi
TOAST N' JAM
Male User Gallery

Registered: 09/05/99
Posts: 31,458
Loc: 613 Flag
Markov chains [Re: Kronikism]
    #26280046 - 10/27/19 11:09 AM (4 years, 3 months ago)

Link some source text and I can feed it through the earlier program. Probably there are lots of web based things to do it too.

I have mostly been concentrating on something specific to the TNG script format. Already it can generate stuff for a particular character but I want it to choose what character is likely to speak next for a particular scene location. And also maybe if they mention some other character then that character is more likely to speak next in that scene.

The concept of Markov chains overall is that there are only a fixed number of states, and transition to other states from a given state is probability based. The states could correspond to words, musical notes, tic tac toe game configurations, robot actions, whatever.

With words in the simplest form you're looking at keeping track of all the words that were seen in the source text, and then for each word you keep track of every word that has directly followed that word. By updating weights each time you see a particular linkage, later you can do a "random walk" where linkages recorded more often are more likely to be chosen next.

Part of the reason a simple version produces a lot of really unintelligible results is that the next word is chosen based only on the current word, and not on anything that came before that in the generated sequence. Beyond that there is no working model of English grammar. Though I guess you could just run the generated lines through an existing grammar check program and discard ungrammatical ones.


Extras: Filter Print Post Top
Onlinegopher
Coffee Bean Extraordinaire
I'm a teapot

Registered: 11/22/17
Posts: 13,170
Loc: Canada Flag
Last seen: 2 minutes, 33 seconds
Re: Markov chains [Re: psi] * 1
    #27281478 - 04/25/21 12:04 PM (2 years, 9 months ago)

I tried to create a new one,just generates a sentence, I kept adding to it as corner cases came up, and now I dont even fully what its doing in three situations, im going to look into debuggers soon and see if a debugger can walk me through it, the code is paste binned here and the three texts used are jesus.txt, covid.txt, nirvana_lyrics.txt

Code:


import re
import random

exceptions = ['Dr.', 'Mr.', 'Lt.', 'Gov.', 'Col.', 'B.1.1.7']

def create_word_list(reg_list):
word_list = reg_list[0].split()
return word_list

def check_for_punct(word):
if word[-1] in '.?!':
if word in exceptions:
return False
else:
return True
else:
return False

def create_word_bank(word_list, ngram_val):
word_bank = {}
for x in range(len(word_list)):
nfg = False
if len(word_list[x : x + ngram_val]) == ngram_val:
key = word_list[x]
value = ' '.join(word_list[x + 1 : x + ngram_val])
if not check_for_punct(key):
for item in exceptions:
if item not in value:
for char in value[ : -1]:
if char in '?!.':
nfg = True
break
if nfg:
pass
else:
word_bank.setdefault(key, []).append(value)
else:
word_bank.setdefault(key, []).append(value)
if check_for_punct(value): #this if block will break ngram size, to stop program from never-
value_list = value.split() #finding punctuation to end on
key = value_list[0]
if len(value_list) >= 2:
value = value_list[1][0:]
else:
value = value_list[0]
word_bank.setdefault(key, []).append(value)
return word_bank



def pick_start_word(word_bank, word_list):
starting_words = []
for key in word_list: #changing to word_list will increase likelyhood of common starts
#for key in word_bank: #changing to word_bank will have each start only once
string = key
if not check_for_punct(string) and string[0].istitle():
starting_words.append(string)
start_word = random.choice(starting_words)
return start_word

def make_sentence(start_word, word_bank):
new_sent = []
new_sent.append(start_word)
while True:
if start_word in word_bank:
next_word = random.choice(word_bank[start_word])
if check_for_punct(next_word):
new_sent.append(next_word)
break
new_sent.append(next_word)
next_word_list = next_word.split()
if len(next_word_list) >= 2: #im not really sure what this if block is doing
start_word = next_word_list[-1] #but its needed to not repeat words
else: #it may be breaking ngram size IDK
start_word = next_word_list[0]
else:
#print("System is Broken!, There is no Start Word")
break
return new_sent

def stringify_list(new_sent):
return ' '.join(new_sent)

def main(corpus, ngram_val):
with open(corpus, 'r') as file:
text = file.read().replace('\n', ' ')

test_sent = re.compile(r'.+')

reg_list = test_sent.findall(text)

word_list = create_word_list(reg_list)
word_bank = create_word_bank(word_list, ngram_val)
start_word = pick_start_word(word_bank, word_list)
#new_sent = make_sentence(start_word, word_bank)
time_the_loop_out = 0
while time_the_loop_out < 1000:
time_the_loop_out += 1
new_sent = make_sentence(start_word, word_bank)
if len(new_sent) > 20 // ngram_val + 2:
continue
elif len(new_sent) < 8 // ngram_val + 2:
continue
else:
break
if time_the_loop_out == 1000:
print("Timed out, try again")
else:
print(stringify_list(new_sent))

print('\nJESUS.TXT \n')
main('jesus.txt', 4)
print('\nCOVID.TXT\n')
main('covid.txt', 4)
print('\nNIRVANA LYRICS.TXT \n')
main('nirvana_lyrics.txt',3)



and heres some sample outputs

Quote:

JESUS.TXT

If any man thirst, let him come and spoken unto you, being yet present with you.

COVID.TXT

Pathogens Program at New York City, said in an interview after the vote.

NIRVANA LYRICS.TXT

Here we are never made her mother proud.






Quote:

JESUS.TXT

Jesus unto them, Be thou removed, and went into a publican, named Levi, sitting at the father of it.

COVID.TXT

The declination rate at the individual level and through social identity, said Dr.

NIRVANA LYRICS.TXT

The tarp has paid off of grass.





Quote:

JESUS.TXT

I have seen with you, and then shall they fast in those days.

COVID.TXT

Farr said she has not been a time to have not been vaccinated, let's grab dinner

NIRVANA LYRICS.TXT

I don't mind, you were my, my dinner there.





--------------------
For most of the normies out there, an operating system is just a bootloader for Google Chrome.

Since Disney has obtained tremendous value from the public domain, knows how important the public domain is, and is firmly determined to never contribute anything to it.

My pronouns are He and Him, and my adjectives are Fat and Jazzy

:kratom:


Extras: Filter Print Post Top
InvisibleCrazy_Horse
I’m Rick James, bitch!
 User Gallery

Registered: 08/15/16
Posts: 13,355
Loc: Hampsterdam
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: gopher] * 1
    #27281677 - 04/25/21 03:32 PM (2 years, 9 months ago)

I'm watching the 'gopher eats salad' movie.


--------------------


Extras: Filter Print Post Top
Onlinegopher
Coffee Bean Extraordinaire
I'm a teapot

Registered: 11/22/17
Posts: 13,170
Loc: Canada Flag
Last seen: 2 minutes, 33 seconds
Re: Judge Churchwell explained that it was illegal for cops to discover the weed was legal. [Re: Crazy_Horse]
    #27281683 - 04/25/21 03:35 PM (2 years, 9 months ago)

Quote:

Crazy_Horse said:
I'm watching the 'gopher eats salad' movie.




spoiler alert, I cant eat it all


--------------------
For most of the normies out there, an operating system is just a bootloader for Google Chrome.

Since Disney has obtained tremendous value from the public domain, knows how important the public domain is, and is firmly determined to never contribute anything to it.

My pronouns are He and Him, and my adjectives are Fat and Jazzy

:kratom:


Extras: Filter Print Post Top
Jump to top Pages: < Back | 1 | 2  [ show all ]

Shop: North Spore Bulk Substrate   Kraken Kratom Red Vein Kratom   PhytoExtractum Buy Bali Kratom Powder   Original Sensible Seeds Autoflowering Cannabis Seeds   Unfolding Nature Unfolding Nature: Being in the Implicate Order


Similar ThreadsPosterViewsRepliesLast post
* Are meter fairies illegal? SillyWilly 1,066 9 07/01/04 10:40 PM
by zi1iz
* My cousin the Cop Dreamer987 2,790 15 12/15/03 02:20 PM
by haz
* Trying to buy illegal drugs is a disturbing mindfuck
( 1 2 3 all )
Comradez 4,955 54 06/29/11 03:55 PM
by thodub
* so i got drunk again, i hate drinking even when i do it responsibly. BAD COP KARMA, HELPPPPP!!! kingofthemtn151 982 5 12/19/05 01:06 AM
by fathertracy
* Any cops on the forum?
( 1 2 3 4 5 6 7 8 9 all )
indica 9,407 171 11/18/13 05:20 AM
by Cannabischarlie
* Is Shroom or MJ Cultivation Illegal in Holland? MOTH 1,254 10 01/13/04 08:13 PM
by Wilf
* Illegal Search?
( 1 2 all )
Cujo 3,749 29 10/21/05 06:17 PM
by SoulSuuckinJERK
* A girl I know gets beat up, and I talk to the cops on acid
( 1 2 3 all )
Toe_Jam 4,353 47 06/26/11 11:23 AM
by ShiVersblood

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: Entire Staff
708 topic views. 7 members, 40 guests and 61 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.038 seconds spending 0.009 seconds on 15 queries.