[Haskell-cafe] Re: How would you hack it?
Achim Schneider
barsoap at web.de
Wed Jun 4 17:25:07 EDT 2008
Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> Achim Schneider wrote:
> > Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> >
> >
> >> I have a file that contains several thousand words, seperated by
> >> white space. [I gather that on Unix there's a standard location for
> >> this file?]
> > Looking at /usr/share/dict/words, I'm assured that the proper
> > seperator is \n.
> >
>
> Thanks. I did look around trying to find this, but ultimately failed.
> (Is it a standard component, or is it installed as part of some
> specific application?)
>
ksf at solaris ~ % equery b /usr/share/dict/words
[ Searching for file(s) /usr/share/dict/words in *... ]
sys-apps/miscfiles-1.4.2 (/usr/share/dict/words)
ksf at solaris ~ % eix miscfiles
[I] sys-apps/miscfiles
Available versions: 1.4.2 {minimal}
Installed versions: 1.4.2(18:27:27 02/14/07)(-minimal)
Homepage: http://www.gnu.org/directory/miscfiles.html
Description: Miscellaneous files
> > Generate a Map Int [String] map, with the latter list being an
> > infinite list of words with that particular size.
> >
> > Now assume that you want to have a 100 character sentence. You
> > start by looking if you got any 100 character word, if yes it's
> > your sentence, if not you divide it in half (maybe offset by a
> > weighted random factor [1]) and start over again.
> >
> > You can then specify your whole document along the lines of
> >
> > (capitalise $ words 100) ++ ". " ++ (capitalise $ words 10) ++ "?"
> > ++ (capitalise $ words 20) ++ "oneone1!"
> >
> > [1] Random midpoint displacement is a very interesting topic by
> > itself.
>
> I'm not following your logic, sorry...
>
That's probably because I just described the points and not the rest
of the morphisms... imagine some plumbing and tape between my sentences.
Midpoint displacement is a great way to achieve randomness while still
keeping a uniform appearance. In the defining paper, that I don't have
ready right now, an example was shown where a realistic outline of
Australia was generated from ten or so data points: If you display it
next to the actual outline, only a geographer could tell which one's
the fake.
--
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
signature prohibited.
More information about the Haskell-Cafe
mailing list