Skip to content

Commit

Permalink
feat: add address based dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
gere-lajos committed Apr 20, 2024
1 parent 380a800 commit 4624b6d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Config
{
public const string ADDRESS_FILE = __DIR__ . '/Dictionary/address.csv';
public const string MISC_FILE = __DIR__ . '/Dictionary/misc.csv';
public const string NAMES_FILE = __DIR__ . '/Dictionary/names.csv';
public const string WORDS_FILE = __DIR__ . '/Dictionary/words.csv';
Expand Down
7 changes: 7 additions & 0 deletions src/Dictionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace GereLajos\MeowMaker;

use GereLajos\MeowMaker\Enums\AddressType;
use GereLajos\MeowMaker\Enums\DictionaryType;
use GereLajos\MeowMaker\Enums\MiscType;
use GereLajos\MeowMaker\Enums\NameType;
Expand All @@ -13,6 +14,11 @@ class Dictionary
{
private array $dictionary = [];

public function address(AddressType $type): array
{
return $this->returnOrLoadFile(DictionaryType::ADDRESS)[$type->value];
}

public function misc(MiscType $type): array
{
return $this->returnOrLoadFile(DictionaryType::MISC)[$type->value];
Expand Down Expand Up @@ -40,6 +46,7 @@ private function returnOrLoadFile(DictionaryType $type): array
private function loadFile(DictionaryType $type): void
{
$file = match($type) {
DictionaryType::ADDRESS => Config::ADDRESS_FILE,
DictionaryType::MISC => Config::MISC_FILE,
DictionaryType::NAMES => Config::NAMES_FILE,
DictionaryType::WORDS => Config::WORDS_FILE,
Expand Down
13 changes: 13 additions & 0 deletions src/Enums/AddressType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace GereLajos\MeowMaker\Enums;

enum AddressType: string
{
case COUNTRY = 'country';
case CITY = 'city';
case STREET = 'street';
case STREET_SUFFIX = 'street_suffix';
}
1 change: 1 addition & 0 deletions src/Enums/DictionaryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

enum DictionaryType: string
{
case ADDRESS = 'address';
case MISC = 'misc';
case NAMES = 'names';
case WORDS = 'words';
Expand Down
4 changes: 4 additions & 0 deletions src/dictionary/address.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
country:Meowmania,Purrlandia,Feline Federation,Catland,Tabby Territories,Siamese States,Lynxland,Clawdia,Pawsylvania,Tiger Territory,Whiskerstan,Purrsia,Catmandu,Catopia,Fluffopolis,Napland,Kittistan,Slinkyside,Velvet Valley,Tigris Terra,Mewtopia,Purrth,Furrance,Meowrocco,Catada,Kitten Kingdom,Scratchpadia,Meowschwitz,Catlantis,Feline Island,Tortieland,Hissania,Tabbytown,Scratchia,Pawpaw Principality,Meowagascar,Felinia,Tabbyton,Meowngolia,Scratchmark,Furrginia,Nyan Nation,Catalunya,Purrasia,Clawmoor,Hissyfit Harbor,Tailtopia,Bristleburg,Purrch Republic,Kittycoast
city:Meowtropolis,Purrsville,Tabby Town,Clawchester,Whisker City,Siameapolis,Lynxtown,Furrfield,Pawston,Tiger City,Scratchville,Neko City,Cattingham,Kittenshire,Feline Falls,Napville,Velvet Vista,Litterbox Landing,Fluffy Forks,Pounceville,Snuggle City,Grooming Grove,Hiss Hollow,Meowsburg,Tailton,Calico Corner,Purrlin,Meowming,Purrmuda,Tigrisburg,Furrville,Kitty Cove,Meowmi,Catlantic City,Whiskerwood,Purrington,Scratch Springs,Silky Sands,Whisperwind,Feline Fort,Tabby Terrace,Softpaw,Catnip City,Tailsdale,Bristletown,Scratchfield,Leaplyn,Velvetville,Kitten Key,Claw Cove
street:Whisker,Purr,Tabby,Claw,Meow,Feline,Siamese,Lynx,Velvet,Tiger,Scratchpost,Neko,Catnip,Kittenshire,Fluffy,Nap,Soft,Litterbox,Grooming,Hiss,Tail Twist,Calico,Purrlin,Mew,Purrmuda,Tigris,Furr,Kitty,Meowmi,Catlantic,Whiskerwind,Purrington,Scratch,Silky,Whisperwind,Feline,Tabby,Softpaw,Catnip,Tailsdale,Bristle Boulevard,Scratchfield,Leaplyn,Velvetville,Kitten,Claw,Catwalk,Tumbleweed,Meow,Pounce
street_suffix:Lane,Trail,Court,Main,Avenue,Street,Lane,Road,Tail Turn,Nook,Crescent,Court,Freeway,Drive,Paw Path,Lane,Grove,Highway,Crossroad,Parkway,Way,Passage,Terrace,Furrow,Corner,Mews,Circle,Place,Springs,Sands Avenue,Walk,Fort Road,Terrace,Street,Court,Turnpike,,Street,Lane,Vale,Key Krossing,Cove Court,Circle,Trail,Maple Lane,Path

0 comments on commit 4624b6d

Please sign in to comment.