Mark V. Shaney

February 27, 2009

In the mid-1980’s, Mark V. Shaney posted messages such as this to the Usenet group

I seem to be important. For me, it would have agreed with the
technical insight that is dear to me. Because of this, I have no
advice for someone in that situation!

Joining Mensa was something I did him one better. I wore a dress skirt
a day for one week. I did him one better. I wore a dress skirt a day
for a 2 year relationship. I’m wondering if anyone else out there has
ever experienced this phenomena, whether it was actually your
contention that this is true for me.

I suppose it depends how you felt about someone before you became
emotionally attached and therefore “safer” – not to sporting events,
but to opera.

I lost 90 lbs a few months during my “flower child” days in high school
where, due to her high academic standings, was shunned by many of the
tube. The experience really screwed them up — if not their heads,
their knees. Why does one have to be the prime measurement of
manhood. No?

He was a scrawny, spastic nerd in high school, and I fantasized about
such a thing. It all depends on the sidelines, listening to what makes
the rest of the guys around her – suddenly finds herself in a situation
where guys are asking them out!? But this can result in members of
either the person of your dreams (in a larger number of males to
females studying the field of engineering), the ratio of males to
females is somewhere in the past. And, per the other person.

I find it hard to reconcile the notion that something or someone isn’t
theirs anymore. I have a date with the woman. Subjectively, I have
also acted in this weekend.

However, Shaney wasn’t a person. Shaney was a bot created by three Bell Labs researchers — Bruce Ellis, Rob Pike and Don Mitchell — that analyzed Usenet postings and then created its own posting. Shaney’s writings were quirky, non-sensical, and beloved by many.

Shaney worked by reading a training text and saving each triple of words that appear in the training text in a large table. Then it generates text using a markov chain, starting with two words that appear in the training text and repeatedly writing the third word of the triple, sliding the output window from word to word. The genius of the method is that any two words may appear in the training text with multiple following words, and the generator is free to choose any of them; thus, short fragments of text make sense, but the text as a whole frequently veers from one train of thought to another. A word includes its surrounding punctuation, so that sentence structure and, indirectly, grammar, are built in to the output.

Write a program that implements Shaney.


Pages: 1 2

8 Responses to “Mark V. Shaney”

  1. Roger said

    That’s really interesting. It gives surprisingly good results. I have sume problems to running your code, though. Some of the brackets seem to be wrong, but even after correcting them the code does not run in Plt Scheme. Which version of Scheme did you use?

  2. programmingpraxis said

    Sorry. It’s fixed now, including a link to Thanks.

  3. […] 26, 2009 Dictionaries are a common data type, which we have used in several exercises (Mark V. Shaney, Word Frequencies, Dodgson’s Doublets, Anagrams). Hash tables are often used as the […]

  4. Interesting and funny.

    import qualified Data.Map as M
    import Data.List
    import Control.Applicative ((<$>))
    import System.Random
    import System.Environment (getArgs)
    type WordMap = M.Map (String, String) [String]
    -- Utilités
    oneOf    :: [a] -> IO a
    oneOf xs = do
      index <- randomRIO (0, limit)
      return (xs !! index)
     where limit = length xs - 1
    takeByN       :: Int -> Int -> [a] -> [[a]]
    takeByN _ _ [] = []
    takeByN n step xs = take n xs : takeByN n step (drop step xs)
    buildWordTable      :: String -> WordMap
    buildWordTable text = foldl' insertTriple M.empty mots
        where mots = takeByN 3 1 $ words text
              insertTriple m [a, b, c] = M.insertWith' (++) (a,b) [c] m
              insertTriple m _         = m
    buildMapFromFile   :: FilePath -> IO WordMap
    buildMapFromFile f = do
      content <- readFile f
      return $ buildWordTable content
    -- The random walk through the words
    walk         :: (String, String) -> WordMap -> IO [String]
    walk key@(a,b) m = do
      case M.lookup key m of
        Nothing -> return []
        Just ws -> do
                choice <- oneOf ws
                rest <- walk (b, choice) m
                return $ choice : rest
    shaney     :: Int -> FilePath -> IO String
    shaney n f = do
      m <- buildMapFromFile f
      [a,b] <- take 2 . words <$>  readFile f
      randomWords <- walk (a,b) m
      return (format $ a:b: take (n-2) randomWords)
          where format ws = unlines $ map unwords (takeByN 10 10 ws)
    main = do
      args <- getArgs
      case args of
        [n, f] -> putStrLn =<< shaney (read n) f
        _ -> error "Deux arguments requis."
  5. mshacker12 said

    I have found what appears to be a markov-cypher(D) post in the weridist place – on a complaints fourm!!!

    This might be the work of shaney:



    ODD RIGHT?????

  6. This has to be the most fun programming exercise I have ever done.

    The best thing my program said was “Your monkeys ass is in my daughters orange juice.”

    I’m working on some improvements, it should hopefully be finished tomorrow!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: