This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Randomly generate names based on a lexicon
version 1.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-08-12 14:15:10 UTC
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1
elm-community/random-extra 2.0.0 <= v < 3.0.0 2.0.0

Modules

README

Lexicon-based random name generator

This package can be used to generate random names according to a given lexicon.

The quality of the output depends on the quality of the lexicon.

You can check the (undocumented) tools I used to generate the english lexion.

import LexicalRandom


lexiconString =
    """
# this is a comment

streetType
    # definitions can be separed by comma or newline, it's the same
    street,road,avenue,drive,
    parade,square,plaza

namePrefix
    Georg,Smiths,Johns

nameSuffix
    chester,ington,ton,roy

surname
    {namePrefix}son
    {namePrefix}{nameSuffix}

address
    {surname} {streetType}
"""


streetNamesLexicon =
    LexicalRandom.fromString lexiconString
        |> Random.map String.Extra.toTitleCase


streetNamesRandomGenerator : Random.Generator String
streetNamesRandomGenerator =
    LexicalRandom.generator "???" streetNamesLexicon "address"