Showing posts with label Perl. Show all posts
Showing posts with label Perl. Show all posts

Tuesday, March 11, 2014

Today's Dose of Dissociate Sumerian Proverbs


The settings for this run of Dissociate were -c2 -w1



Don't know your own name? Shame on you!

You are an outstanding scribe; you are forever pushing, like a fearful slave girl.

To the trustworthy man belongs a divine voice.

The battle-club would not come out to me.  I am insulted. 

Their place in the universe was eradicated. -- You should not destroy the place!

To purchase a wagon is to be eaten alone.

Let him go down. Let him who has a valuable role to play

Walk like a slave. Walk like a goat.

Who repays a favor?

The anus is well supplied.

In the city of the lame, a cripple stand up?

The poor man inflicts all kinds of trouble for the wealthy man.

In the desert there is the lion accustomed to performing the brewers' craft? 

I was always walking, because I was always walking

I am confronting fate: "speak in the way of a wicked man".

When did we last see you run away anywhere?" a lame man came running to the other side of the mouth. 

The palace children and wives and trading agents! How they use up silver!

Once I had escaped, the wild cow confronted me.

It is the weakness of the widows. It is the one with whom she quarrels.

Your flesh has not yet filled my mouth.

One should submit oneself to his anus.

Luck? When I enter a sleeping city, the dogs began to howl.

His tongue is in the way of a wicked man

For his pleasure he got divorced.

He gathered everything for himself, but also for his owner: A pig 

An excitable man should eat it. Unless it stinks.

The poor man should not remove what belongs to a god.

A shepherd should not take a merchant for his friend.

What belongs to a god should not become an overseer.

This shall be my share: no man can go about their business, not even a plenipotentiary.

Let me fill your new storehouse with my companion!

So it is the beer! Sweet.

Sunday, March 9, 2014

The Dissociate Script and Batch

I'm using the ActiveState install of Perl64. After I completed the installation I installed the Dissociate module by using ppm [the perl package manager].

I created a Perl script to call the Dissociate module. I named the script diss.pl. It contains the following:

#!/usr/local/bin/perl
use Games::Dissociate; dissociate_filter; 
srand();

The srand() command was added after I found that it did not seem that the output of the filter was "random enough".

I call the script using a batch file. Here is an example of a character level filter with the n-gram set to 6

perl diss.pl -c6 -m10000 SumProvb-all.txt>SD6-c6.txt 

The file "SumProvb-All.txt" contains 1042 Sumerian proverbs. The stdio is piped to an out put file named "SD6-C6.txt". Here is a  small sample of the "raw" output of this batch file:
How can a poor man! The nine of you hurt?" The meaning, that city of the lame, the heavens. Let the water. Like a horse you paw the relevant information, it is an abomination to Succumb will be your exercise tablet!

Between our feet like sandals!" Before the heart does not know fear of god creates good fortune reinforce the winds. Wealth is exposed to me. In my heart that aches. May Lumma grant prosperity, the one there. The cow walks about, she loses something consumed by fire, those behind him don't say: "When will earn his packs, said: "The whole of the she-goat: "Let me pull at my husband's embrace. Sons-in-law -- what will listen to you! Youthful penis with interest payments so small?" He who can lifts his gaze to you Enlil look upon the city that he cursed." The prosopis plant is hired.

Don't give the slave girl. Her friend? She growls like your canal? like a runaway slave girl, I have no authority over my mistress It just one day but leaves my heart, which Me-silim had built by a treacherous. O lion, your allies in the rest. Slander occurs where there are carried. Your outhouse is the water?" "I sprinkle the ground. In the palace. Each fox is everywhere. You are pouring out, so that it does not become forth from it.

For a word level n-gram I use a batch file which contains something like:

perl diss.pl -w2 -m10000 SumProvb-all.txt>wsd3-w2.txt

The -w2 denotes a word level n-gram of 2. The resulting output looks like:

head succeeds in crossing the river. He who was seized by anger poured it out: "I am carrying my city to the fold, the lion cried: "I release you!" She said to his wife: "examined her: "At least I am all alone." The word of his father is an abomination to Ninurta. To serve beer with unwashed hands, to one's god. split it, And this after you split it? What kind of a wolf.

You should not alienate their rituals! Where there are no dogs, the fox could not overturn the anvil, so it overturned the water-provided for him.

A fool. Because I was flapping my arms like a bird. flying around is your share. Nine wolves having caught ten sheep, there was one too many and they did not fart in her husband's embrace. Sons-in-law -- what have they brought? Fathers-in-law -- rejoices over it: "It became cloudy, but it does not understand: "Put it down!" The donkey after he had thrown off his packs, said: "Now I can forget my burdens of former days!" The donkey, after he had thrown off his packs, said: "Now I can forget the burdens of former days!" The duck is the glory of the fields. is to forget. For him who dances, the sun shines. For the swaggerer; he is afflicted with diseases. Putting unwashed hands to spit without covering it with dust, and to seize should be abominations there. Enlil's temple is a cloth stretched out in the desert; A plant as sweet as a slave girl, Let her eat the flesh of a wolf. is eating. Utu looks down on it and didn't recognise what was in it. A cause for celebration. An unjust heir who does not support a wife, during a festival! Don't give Don't know you own name? Shame on you! You are an outstanding scribe; you are forever pushing, like a fearful slave girl. 

Now all you need do is cherry pick what looks like good one liners, verify that they are not in the source file. For those who like to play with this kind of stuff and have experience in Perl, Dissociate can also be called as a function



Wednesday, March 5, 2014

Sumerian Proverbs Meet the Dissociate Press

Dissociate Press is a Perl script based Markov filter based upon an EMACs script. as the Man page says:
This module provides the function `dissociate', which implements a
Dissociated Press algorithm, well known to Emacs users as "meta-x
dissociate". The algorithm here is by no means a straight port of
Emacs's `dissociate.el', but is instead merely inspired by it.

The Book of Proverbs has a worthy ancestor in the baked clay tablets which contain the Sumerian Proverbs A good sampling of these proverbs can be found in  The Electronic Text Corpus of Sumerian Literature at Oxford

I thought I'd give a sample of what Sumerian Proverbs look like after being "filtered" with the Dissociate Perl Script.  If you are wondering the quotes below were "cherry picked" from the output stream but samples were taken verbatim from the output stream. I verified that none of the quotes below appeared in exactly the same form in the original input stream. Some punctuation has been added or removed but the "output streams were not tampered with.

The output below is from two runs one with the filter set at -w1 and the second at -w2.

Some of what you see below is nonsense. Some of it is interesting... to varying degrees.... there are also some actual fundamental "truths".

++++++++++++++++++++++++

A shepherd's sex appeal is his friend.

As long as you live you should not increase for mankind his food demands.

It is a curse resulting from a man's mouth taste bitter. 

Let me tell you of my condition: it makes no difference.

You should not have given birth to fifty young.

The dry land did not know how to write your own good. 

Fate is a dog, in a household of his friend?

How lowly is the poor? It is the food basket.   

The claws of a cat can find a hole-- he makes a living, he offers a prayer. He is fearful, like a man.

The voice of the duck was not pleasant.

He does not fart... in her house.

Marry the wife of your harvesting, it is characteristic of the blessing of Aratta.

Do not make me uneasy. As long as you live, you should not eat his acquaintance. 

Something offered is not offered. Something finished is not appreciated. 

A runaway donkey, will not turn back. 

The glory of the frog is the glory of the refugee.

Because I was flapping my arms like a bird flying around is your share.

A chattering girl is silenced by his mother.

If you get rid of the shepherd, then his sheep will not come back into his charge.

The clod on the other hand.

Like a whelping bitch. 

Bitterness afflicted the anus; but it entered by way of the eye of the storm.

A chained dog starts a fight... with a wooden bat.

The poor man is not accepted.

Bring me my tools and I will live for today.

She who says "My expense" is her girl friend. 

He who rents a donkey for a whole year kindles a fire. Those behind him don't say: "Where is the leader?"

The ruler of the city is Idibi. Its king's daughter cannot avoid the wasteland. 

A king's property- What has been spoken in secret will be destroyed!

A disgraced scribe becomes an incantation priest. A disgraced lamentation priest whose incantations do not eat for pleasure.

A tenant established the field.

When he is dead, he is indeed a scribe!

O lion, your allies in the reed-beds will eat you.

The frog is the glory of the refugee.

A plant as sweet as a slave girl-- Let her eat the flesh of a wolf.

In the city where there is no toughness, no man can bring about your demise. 

the poor man caused all kinds of illnesses on the rich man's work.

The young man said: "Ah god!" and the boat sinks.

Left-over clothes are the glory of the gardens.

No one can rival the wise man.

 Whatever the man in authority said, it was not apparent to the slave girl of a lukur priestess. "Let me fill your new storehouse with interest. "

The wild cow at the top... it does not know Sumerian? 

"I am one whose fate has not been destroyed, let more places be destroyed. In those places which have not been destroyed, belongs to my mistress.

The heart does not abandon the good. 

The gecko wears a beard.

The dishonest man is destroyed by the treacherous man.

I am stretching my legs on your behalf," says the man lying on the dry ground.

"I'm fat!" would be the inheritance given to you. 

One does not marry a three-year-old wife as a donkey

The steward does not know fear of god.

When the dishonest man stole silver; the honest man will earn his pay.

Who can compete with righteousness? 

You should not increase evil by telling lies

When you walk behind, the vixen quenched her thirst.

In marrying a malicious son, an unhappy heart was assigned to me.

Punishment is assigned for the necromancer. 

You are not one who stays in ones hand.

O mule, do you know your mother?

Wicked things are strong.

The lion who lives from birds and fish cannot sleep.

The young scribe is too concerned with feeding his hunger.

++++++++++++++++++++++++++



Footnotes:
In a later post may try to simulate "a partially legible tablet... "

In developing the batch files I used to glean the above quotes I made various rounds with many different values for -W [the word level feature] or  -C [a character level filter]. I ended up selecting to first post from the -w1 -w2 runs...

After the runs were complete, I spent several hours reviewing the output streams and an idea began to build up as I skimmed the texts and compared it to the input file. I noticed that there appears to be an implied "dimension" to the text output stream.  Now this may just be an artifact of the methodology used to cut-up and re-arrange the text. But it also might imply something about language and language users... that like the "coastline of Great Britain", there is a "Fractal dimension" to the pattern and flow of a language and that individual users or thematic styles may have a "unique" dimension.

I'll have to think on this. If you have any suggestions how one might go about "testing" this hypothesis I'd love to hear it.