(The best SQL database)
Best bet is to use http://postgresapp.com/ .
Make sure to set up your path once it's installed:
- Run
atom ~/.bash_profile
. - Add the line
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/latest/bin
- Save and close the file.
Download the installer from http://www.enterprisedb.com/products-services-training/pgdownload#windows and run it. I don't have a Windows machine, so please comment here if you have more guidance.
Use your distro's package manager to install postgres.
At a terminal prompt, run createuser prosaic
and then createdb prosaic
. This is the default location where prosaic stores snippets of text.
If you're on a window's machine and this doesn't work, let me know and I'll figure out what the right thing to do is.
pip
is the python package manager (meaning: it's how we download and share libraries that don't come pre-installed). Run python3 -m pip install prosaic
to install prosaic.
- Something sort of permission-denied error: On mac or linux you may need to prefix the command with
sudo
, so runsudo python3 -m pip install prosaic
. - On a Mac: "something something requires the command line developer tools". Go ahead and install them. It may take a while to download, because they're about 130MB.
Prosaic depends on nltk
, the natural language toolkit, which in turn depends on some big files. They will download the first time you go to use it. Open up a python3
REPL and type import prosaic
. This will kick off a large-ish download.
Is everything working so far?
- Running
pg_config
should print out a bunch of text:
- Running
prosaic --help
at the command line should print out a message like this:
There's an official tutorial at https://github.com/nathanielksmith/prosaic/blob/master/doc/tutorial.md I ran into a couple issues that weren't addressed there, so I wrote the following.
I'm going to add the Mean Girls script. I'll make a file mean_girls.txt containing just the text I want. Then I run prosaic source new mean_girls mean_girls.txt
.
For some reason, this is giving me an error:
There was an error extracting phrases:
********
4
********
The source 'mean_girls' was not saved.
But it seems to work, contrary to the message. ¯\_(ツ)_/¯ . I have a github issue about this at vilmibm/prosaic#36.
Add any other sources you might want.
A corpus is (for prosaic) the combination of several text sources. This allows greater control for mixing and matching which sources being used.
prosaic corpus new my_first_corpus
prosaic corpus link mean_girls
$ prosaic poem new --corpus my_first_corpus -t haiku # (t for 'template')
Yeah, I'll be right back
- North Shore, who do you select
Great turnout this year
$ prosaic poem new --corpus mean_girls -t sonnet
They're these weird Swedish nutrition bars
Contestants, find the limit of this equation
you're supposed to suck the poison out
And a piece for Regina George
Dude, put on The Ramayana Monkey Chant
you know what I mean
There are gonna be girls there in their bathing suits
Im doing major Plastic sabotage tonight
You think that everybody is in love with you
so don't bring some other guy with you
I have her test results
In January, Regina had put a Spring Fling dress on hold at a store called --
From Marymount, Miss Caroline Krafft
I was half a virgin when I met him
Other templates are available (run prosaic template ls
to see a list). You can also write your own, which is covered in the official tutorial.
createuser and createdb do not work on my Windows machine. What could be my alternative?