예제 #1
0
#!/usr/bin/env python3

from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate
from engine.util import name_generator_by_argparse

__author__ = 'mshmidov'

RIVER_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 3)
RIVER_DE.populate_from(line.casefold().strip() for line in open('seed/rivers/river_de.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'river': lambda: RIVER_DE.sequence().title()})
예제 #2
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse

__author__ = 'mshmidov'

from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

GERMANIC_PEOPLE = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                                    lambda s: len(s) > 4)
GERMANIC_PEOPLE.populate_from(
    line.casefold().strip()
    for line in open('seed/tribes/germanic_people.txt'))

if __name__ == '__main__':
    name_generator_by_argparse(
        {'people': lambda: GERMANIC_PEOPLE.sequence().title()})
예제 #3
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

SURNAME_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 3)
SURNAME_RU.populate_from(line.casefold().strip() for line in open('seed/names/russia/surnames-russian.txt'))

SURNAME_GENERAL_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 3)
SURNAME_GENERAL_RU.populate_from(line.casefold().strip() for line in open('seed/names/russia/surnames-russian-general.txt'))

SURNAME_NOBLE_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 5)
SURNAME_NOBLE_RU.populate_from(line.casefold().strip() for line in open('seed/names/russia/surnames-russian-noble.txt'))

SURNAME_BOYAR_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
SURNAME_BOYAR_RU.populate_from(line.casefold().strip() for line in open('seed/names/russia/surnames-russian-boyar.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'simple': lambda: SURNAME_RU.sequence().title(),
                                'general': lambda: SURNAME_GENERAL_RU.sequence().title(),
                                'noble': lambda: SURNAME_NOBLE_RU.sequence().title(),
                                'boyar': lambda: SURNAME_BOYAR_RU.sequence().title()})
예제 #4
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

CITY_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 3)
CITY_RU.populate_from(line.casefold().strip() for line in open('seed/cities/city_ru.txt'))
CITY_RU.populate_from(line.casefold().strip() for line in open('seed/cities/city_gp.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'city': lambda: CITY_RU.sequence().title()})
예제 #5
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse

__author__ = 'mshmidov'

from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

SLAVIC_PEOPLE = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
SLAVIC_PEOPLE.populate_from(line.casefold().strip() for line in open('seed/tribes/slavic_people.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'people': lambda: SLAVIC_PEOPLE.sequence().title()})

예제 #6
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

NAME_M_EN = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                              lambda s: len(s) > 4)
NAME_M_EN.populate_from(
    line.casefold().strip()
    for line in open('seed/names/england/names-medieval-norman-m.txt'))
NAME_M_EN.populate_from(
    line.casefold().strip()
    for line in open('seed/names/england/names-medieval-norse-m.txt'))
NAME_M_EN.populate_from(
    line.casefold().strip()
    for line in open('seed/names/england/names-medieval-rarities-m.txt'))

NAME_F_EN = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                              lambda s: len(s) > 4)
NAME_F_EN.populate_from(
    line.casefold().strip()
    for line in open('seed/names/england/names-medieval-norman-f.txt'))
NAME_F_EN.populate_from(
    line.casefold().strip()
    for line in open('seed/names/england/names-medieval-norse-f.txt'))
NAME_F_EN.populate_from(
    line.casefold().strip()
    for line in open('seed/names/england/names-medieval-rarities-f.txt'))

SURNAME_EN = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                               lambda s: len(s) > 4)
예제 #7
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

CITY_PL = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 3)
CITY_PL.populate_from(line.casefold().strip() for line in open('seed/cities/city_pl.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'city': lambda: CITY_PL.sequence().title()})
예제 #8
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

SURNAME_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                               lambda s: len(s) > 3)
SURNAME_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/surnames-russian.txt'))

SURNAME_GENERAL_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                                       lambda s: len(s) > 3)
SURNAME_GENERAL_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/surnames-russian-general.txt'))

SURNAME_NOBLE_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                                     lambda s: len(s) > 5)
SURNAME_NOBLE_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/surnames-russian-noble.txt'))

SURNAME_BOYAR_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                                     lambda s: len(s) > 4)
SURNAME_BOYAR_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/surnames-russian-boyar.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({
예제 #9
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

NAME_M_EN = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
NAME_M_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/names-medieval-norman-m.txt'))
NAME_M_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/names-medieval-norse-m.txt'))
NAME_M_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/names-medieval-rarities-m.txt'))

NAME_F_EN = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
NAME_F_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/names-medieval-norman-f.txt'))
NAME_F_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/names-medieval-norse-f.txt'))
NAME_F_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/names-medieval-rarities-f.txt'))

SURNAME_EN = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
SURNAME_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/surnames-old-english.txt'))
SURNAME_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/surnames-trade.txt'))
SURNAME_EN.populate_from(line.casefold().strip() for line in open('seed/names/england/surnames-byname.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'male': lambda: NAME_M_EN.sequence().title(),
                                'female': lambda: NAME_F_EN.sequence().title(),
                                'surname': lambda: SURNAME_EN.sequence().title()})
예제 #10
0
#!/usr/bin/env python3

from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate
from engine.util import name_generator_by_argparse

NAME_M_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
NAME_M_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/names-germanic-m.txt'))
NAME_M_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/names-low-german-m.txt'))
NAME_M_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/names-medieval-germany-m.txt'))

NAME_F_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
NAME_F_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/names-germanic-f.txt'))
NAME_F_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/names-low-german-f.txt'))
NAME_F_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/names-medieval-germany-f.txt'))

SURNAME_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()), lambda s: len(s) > 4)
SURNAME_DE.populate_from(line.casefold().strip() for line in open('seed/names/europe/surnames-germany.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'male': lambda: NAME_M_DE.sequence().title(),
                                'female': lambda: NAME_F_DE.sequence().title(),
                                'surname': lambda: SURNAME_DE.sequence().title()})
예제 #11
0
#!/usr/bin/env python3

from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate
from engine.util import name_generator_by_argparse

NAME_M_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                              lambda s: len(s) > 4)
NAME_M_DE.populate_from(
    line.casefold().strip()
    for line in open('seed/names/europe/names-germanic-m.txt'))
NAME_M_DE.populate_from(
    line.casefold().strip()
    for line in open('seed/names/europe/names-low-german-m.txt'))
NAME_M_DE.populate_from(
    line.casefold().strip()
    for line in open('seed/names/europe/names-medieval-germany-m.txt'))

NAME_F_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                              lambda s: len(s) > 4)
NAME_F_DE.populate_from(
    line.casefold().strip()
    for line in open('seed/names/europe/names-germanic-f.txt'))
NAME_F_DE.populate_from(
    line.casefold().strip()
    for line in open('seed/names/europe/names-low-german-f.txt'))
NAME_F_DE.populate_from(
    line.casefold().strip()
    for line in open('seed/names/europe/names-medieval-germany-f.txt'))

SURNAME_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                               lambda s: len(s) > 4)
예제 #12
0
#!/usr/bin/env python3

from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate
from engine.util import name_generator_by_argparse

__author__ = 'mshmidov'

RIVER_DE = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                             lambda s: len(s) > 3)
RIVER_DE.populate_from(line.casefold().strip()
                       for line in open('seed/rivers/river_de.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({'river': lambda: RIVER_DE.sequence().title()})
예제 #13
0
#!/usr/bin/env python3

from engine.util import name_generator_by_argparse
from engine.markovchain import MarkovChain, ExcludeSourceElements, FilterByPredicate

NAME_M_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                              lambda s: len(s) > 3)
NAME_M_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/names-slavic-m.txt'))
NAME_M_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/names-russia-latin-m.txt'))

NAME_F_RU = FilterByPredicate(ExcludeSourceElements(MarkovChain()),
                              lambda s: len(s) > 3)
NAME_F_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/names-slavic-f.txt'))
NAME_F_RU.populate_from(
    line.casefold().strip()
    for line in open('seed/names/russia/names-russia-latin-f.txt'))

if __name__ == '__main__':
    name_generator_by_argparse({
        'male': lambda: NAME_M_RU.sequence().title(),
        'female': lambda: NAME_F_RU.sequence().title()
    })