Skip to content

Commit

Permalink
% addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstaticcoder committed May 7, 2017
1 parent 602e3c9 commit 64ca317
Show file tree
Hide file tree
Showing 13 changed files with 43,724 additions and 84,806 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,24 @@ Year
Title
Slug
Text
FirstName
LastName
Name
Pseudonym
Password
Email
Phone
Street
Address
Code
City
Region
Country
Company
Image
File
Folder
Author
FirstName
LastName
Name
Pseudonym
Password
Isbn
Tags
```
Expand Down
9 changes: 9 additions & 0 deletions TEST/blog.dbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ BLOG | count 10
USER

Id : UINT64 | key, incremented
FirstName : STRING | capacity 45
LastName : STRING | capacity 45
Email : STRING | capacity 45
Pseudonym : STRING | capacity 45
Password : STRING | capacity 45
Phone : STRING | capacity 45
Street : STRING
City : STRING | capacity 45
Code : STRING | capacity 45
Region : STRING | capacity 45
Country : STRING | capacity 45
Company : STRING | capacity 45
ItIsAdministrator : BOOL | aqlname IsAdmin

ARTICLE
Expand Down
9 changes: 9 additions & 0 deletions TEST/blog.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ type SECTION struct {

type USER struct {
Id uint64 `db:"Id"`;
FirstName string `db:"FirstName"`;
LastName string `db:"LastName"`;
Email string `db:"Email"`;
Pseudonym string `db:"Pseudonym"`;
Password string `db:"Password"`;
Phone string `db:"Phone"`;
Street string `db:"Street"`;
City string `db:"City"`;
Code string `db:"Code"`;
Region string `db:"Region"`;
Country string `db:"Country"`;
Company string `db:"Company"`;
ItIsAdministrator bool `db:"ItIsAdministrator"`;
}

Expand Down
9 changes: 9 additions & 0 deletions TEST/blog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ drop table if exists `BLOG`.`USER`;

create table if not exists `BLOG`.`USER`(
`Id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`FirstName` VARCHAR( 45 ) NULL,
`LastName` VARCHAR( 45 ) NULL,
`Email` VARCHAR( 45 ) NULL,
`Pseudonym` VARCHAR( 45 ) NULL,
`Password` VARCHAR( 45 ) NULL,
`Phone` VARCHAR( 45 ) NULL,
`Street` TEXT NULL,
`City` VARCHAR( 45 ) NULL,
`Code` VARCHAR( 45 ) NULL,
`Region` VARCHAR( 45 ) NULL,
`Country` VARCHAR( 45 ) NULL,
`Company` VARCHAR( 45 ) NULL,
`ItIsAdministrator` TINYINT UNSIGNED NULL,
primary key( `Id` ) )
engine = InnoDB;
Expand Down
9 changes: 9 additions & 0 deletions TEST/blog.uml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ class SECTION {

class USER {
Id : UINT64
FirstName : STRING
LastName : STRING
Email : STRING
Pseudonym : STRING
Password : STRING
Phone : STRING
Street : STRING
City : STRING
Code : STRING
Region : STRING
Country : STRING
Company : STRING
ItIsAdministrator : BOOL
}

Expand Down
100 changes: 50 additions & 50 deletions TEST/blog_data.aql

Large diffs are not rendered by default.

500 changes: 295 additions & 205 deletions TEST/blog_data.go

Large diffs are not rendered by default.

512 changes: 301 additions & 211 deletions TEST/blog_data.sql

Large diffs are not rendered by default.

209 changes: 167 additions & 42 deletions basil.d
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ class RANDOM
{
string[]
FirstNameArray,
LastNameArray;
LastNameArray,
CityNameArray,
RegionNameArray,
CountryNameArray;
VERTEX[]
VertexArray;
int[ string ]
Expand All @@ -240,33 +243,96 @@ class RANDOM
{
MakeFirstNameArray();
MakeLastNameArray();
MakeCityNameArray(),
MakeRegionNameArray(),
MakeCountryNameArray(),
MakeVertexArray();
MakeWordArray();
MakeSyllableArray();
}

// ~~

void MakeFirstNameArray(
void MakeNameArray(
ref string[] name_array,
string file_path,
bool lines_are_split = false,
bool case_is_fixed = false
)
{
string
text;

text = GetExecutablePath( "first_name_table.txt" ).readText();
FirstNameArray = text.toLower().replace( "\r", "" ).replace( "\n", " " ).strip().split( ' ' );
text = GetExecutablePath( file_path ).readText().replace( "\r", "" );

while ( text.startsWith( "\n" ) )
{
text = text[ 1 .. $ ];
}

while ( text.endsWith( "\n" ) )
{
text = text[ 0 .. $ - 1 ];
}

text = text.replace( "\n\n", "\n" );

if ( lines_are_split )
{
name_array = text.replace( "\n", " " ).strip().split( ' ' );
}
else
{
name_array = text.split( '\n' );
}

if ( case_is_fixed )
{
foreach ( name; name_array )
{
name = name.toLower().GetCapitalizedText();
}
}
}

// ~~

void MakeFirstNameArray(
)
{
MakeNameArray( FirstNameArray, "first_name_table.txt", true, true );
}

// ~~

void MakeLastNameArray(
)
{
string
text;
MakeNameArray( LastNameArray, "last_name_table.txt", true, true );
}

// ~~

void MakeCityNameArray(
)
{
MakeNameArray( CityNameArray, "city_name_table.txt" );
}

// ~~

void MakeRegionNameArray(
)
{
MakeNameArray( RegionNameArray, "region_name_table.txt" );
}

// ~~

text = GetExecutablePath( "last_name_table.txt" ).readText();
LastNameArray = text.toLower().replace( "\r", "" ).replace( "\n", " " ).strip().split( ' ' );
void MakeCountryNameArray(
)
{
MakeNameArray( CountryNameArray, "country_name_table.txt" );
}

// ~~
Expand Down Expand Up @@ -642,6 +708,30 @@ class RANDOM

// ~~

string MakeCityName(
)
{
return PickElement( CityNameArray );
}

// ~~

string MakeRegionName(
)
{
return PickElement( RegionNameArray );
}

// ~~

string MakeCountryName(
)
{
return PickElement( CountryNameArray );
}

// ~~

string MakeWord(
)
{
Expand Down Expand Up @@ -1280,18 +1370,18 @@ class COLUMN
}
else if ( ItIsRandomFirstName )
{
value.Text = Random.MakeFirstName().GetCapitalizedText();
value.Text = Random.MakeFirstName();
}
else if ( ItIsRandomLastName )
{
value.Text = Random.MakeLastName().GetCapitalizedText();
value.Text = Random.MakeLastName();
}
else if ( ItIsRandomFullName )
{
value.Text
= Random.MakeFirstName().GetCapitalizedText()
= Random.MakeFirstName()
~ " "
~ Random.MakeLastName().GetCapitalizedText();
~ Random.MakeLastName();
}
else if ( ItIsRandomEnglish )
{
Expand Down Expand Up @@ -1336,6 +1426,34 @@ class COLUMN
{
value.Text = Random.MakeText( "english", 5, 10 );
}
else if ( Name.endsWith( "FirstName" ) )
{
value.Text = Random.MakeFirstName();

table.PriorFirstName = value.Text;
}
else if ( Name.endsWith( "LastName" ) )
{
value.Text = Random.MakeLastName();

table.PriorLastName = value.Text;
}
else if ( Name.endsWith( "Name" ) )
{
value.Text = Random.MakeLastName();

table.PriorName = value.Text;
}
else if ( Name.endsWith( "Pseudonym" ) )
{
value.Text = Random.MakeName( 6, 8 );
}
else if ( Name.endsWith( "Password" ) )
{
value.Text
= Random.MakeName( 8, 10 )
~ Random.MakeInteger( 1, 999 ).to!string();
}
else if ( Name.endsWith( "Email" ) )
{
value.Text
Expand Down Expand Up @@ -1365,10 +1483,45 @@ class COLUMN
~ " "
~ Random.MakeInteger( 100, 999 ).to!string();
}
else if ( Name.endsWith( "Street" )
|| Name.endsWith( "Address" ) )
{
value.Text
= Random.MakeInteger( 1, 100 ).to!string()
~ " "
~ Random.MakeLastName()
~ " "
~ [
"Street",
"Court",
"Avenue",
"Boulevard",
"Lane",
"Alley",
"Drive",
"Park"
][ Random.MakeIndex( 8 ) ];
}
else if ( Name.endsWith( "Code" ) )
{
value.Text = Random.MakeInteger( 1000, 9999 ).to!string();
}
else if ( Name.endsWith( "City" ) )
{
value.Text = Random.MakeCityName();
}
else if ( Name.endsWith( "Region" ) )
{
value.Text = Random.MakeRegionName();
}
else if ( Name.endsWith( "Country" ) )
{
value.Text = Random.MakeCountryName();
}
else if ( Name.endsWith( "Company" ) )
{
value.Text = Random.MakeLastName();
}
else if ( Name.endsWith( "Image" ) )
{
value.Text
Expand Down Expand Up @@ -1396,37 +1549,9 @@ class COLUMN
else if ( Name.endsWith( "Author" ) )
{
value.Text
= Random.MakeFirstName().GetCapitalizedText()
= Random.MakeFirstName()
~ " "
~ Random.MakeLastName().GetCapitalizedText();
}
else if ( Name.endsWith( "FirstName" ) )
{
value.Text = Random.MakeFirstName().GetCapitalizedText();

table.PriorFirstName = value.Text;
}
else if ( Name.endsWith( "LastName" ) )
{
value.Text = Random.MakeLastName().GetCapitalizedText();

table.PriorLastName = value.Text;
}
else if ( Name.endsWith( "Name" ) )
{
value.Text = Random.MakeName( 6, 9 ).GetCapitalizedText();

table.PriorName = value.Text;
}
else if ( Name.endsWith( "Pseudonym" ) )
{
value.Text = Random.MakeName( 6, 8 );
}
else if ( Name.endsWith( "Password" ) )
{
value.Text
= Random.MakeName( 8, 10 )
~ Random.MakeInteger( 1, 999 ).to!string();
~ Random.MakeLastName();
}
else if ( Name.endsWith( "Isbn" ) )
{
Expand Down
Loading

0 comments on commit 64ca317

Please sign in to comment.