words function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Disco Octopus

    words function

    Hi,

    I would like to have a function that will give me a random phrase based on
    the letters that I have given as input. The phrase must make sense. So, I
    would (initially) make sure that the last word generated would be a noun,
    and all previous words would be an adjective.

    eg.
    $phrase = generatephrase( "abc");

    I would like the value of $phrase to be something like this....
    "another beneficial car"
    or
    "absolutely bodacious cookie"

    I can do this using php, but I wanted to know where I can get the
    following....

    A complete data set (database export or text) list of the english dictionary
    with the attribute or "word type"(noun, adjective, verb, etc).

    So, my question is this......

    a) does this script (or service) exist publically. (this would be preferable
    as I dont want to re-invent anything)?
    b) where can I get a list of dictionary entries.

    Thanks




  • André Næss

    #2
    Re: words function

    Disco Octopus:
    [color=blue]
    > Hi,
    >
    > I would like to have a function that will give me a random phrase based on
    > the letters that I have given as input. The phrase must make sense. So, I
    > would (initially) make sure that the last word generated would be a noun,
    > and all previous words would be an adjective.[/color]
    [color=blue]
    > a) does this script (or service) exist publically. (this would be
    > preferable as I dont want to re-invent anything)?[/color]

    I don't know about anything like that. But it wouldn't surprise me, problem
    is finding it I guess.
    [color=blue]
    > b) where can I get a list of dictionary entries.[/color]

    Ispell comes with american and british english dictionaries:


    André Næss

    Comment

    • Allodoxaphobia

      #3
      Re: words function

      On Tue, 09 Dec 2003 00:25:45 +0000, André Næss hath writ:[color=blue]
      > Disco Octopus:
      >[color=green]
      >> b) where can I get a list of dictionary entries.[/color]
      >
      > Ispell comes with american and british english dictionaries:
      > http://fmg-www.cs.ucla.edu/fmg-membe...ff/ispell.html[/color]

      Not straightforward , tho':

      |[jonz~]grep dictionary /usr/local/share/ispell/english.dict
      |antidictionary
      |benedictionary
      |dictionary/MS
      |nondictionary
      |[jonz~]head /usr/local/share/ispell/english.dict
      |a/RSY
      |aa
      |aal/A
      |aalii
      |aam
      |Aani
      |aardvark/MS
      |aardwolf
      |Aaron/M
      |Aaronic
      |[jonz~]

      Jonesy
      --
      | Marvin L Jones | jonz | W3DHJ | OS/2
      | Gunnison, Colorado | @ | Jonesy | linux __
      | 7,703' -- 2,345m | config.com | DM68mn SK

      Comment

      • Chung Leong

        #4
        Re: words function

        Don't know if a script exists already or not. Shouldn't be hard to write in
        any case.

        There's a link to a list of ~300000 words, with their grammatical functions
        denoted.



        Uzytkownik "Disco Octopus" <discooctopusN0 5PAM@yahoo.com> napisal w
        wiadomosci news:F_6Bb.1083 $hX1.36748@news .optus.net.au.. .[color=blue]
        > Hi,
        >
        > I would like to have a function that will give me a random phrase based on
        > the letters that I have given as input. The phrase must make sense. So, I
        > would (initially) make sure that the last word generated would be a noun,
        > and all previous words would be an adjective.
        >
        > eg.
        > $phrase = generatephrase( "abc");
        >
        > I would like the value of $phrase to be something like this....
        > "another beneficial car"
        > or
        > "absolutely bodacious cookie"
        >
        > I can do this using php, but I wanted to know where I can get the
        > following....
        >
        > A complete data set (database export or text) list of the english[/color]
        dictionary[color=blue]
        > with the attribute or "word type"(noun, adjective, verb, etc).
        >
        > So, my question is this......
        >
        > a) does this script (or service) exist publically. (this would be[/color]
        preferable[color=blue]
        > as I dont want to re-invent anything)?
        > b) where can I get a list of dictionary entries.
        >
        > Thanks
        >
        >
        >
        >[/color]


        Comment

        Working...