Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
brianvoe committed Jan 20, 2024
2 parents bb325f6 + 2ca416e commit a5e6a89
Show file tree
Hide file tree
Showing 38 changed files with 447 additions and 237 deletions.
6 changes: 3 additions & 3 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func addAppLookup() {
AddFuncLookup("appname", Info{
Display: "App Name",
Category: "app",
Description: "Name for an application",
Description: "Software program designed for a specific purpose or task on a computer or mobile device",
Example: "Parkrespond",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -76,7 +76,7 @@ func addAppLookup() {
AddFuncLookup("appversion", Info{
Display: "App Version",
Category: "app",
Description: "Version number for an app, following Semantic versioning format",
Description: "Particular release of an application in Semantic Versioning format",
Example: "1.12.14",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -87,7 +87,7 @@ func addAppLookup() {
AddFuncLookup("appauthor", Info{
Display: "App Author",
Category: "app",
Description: "Name for an app developer or authoring entity",
Description: "Person or group creating and developing an application",
Example: "Qado Energy, Inc.",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
4 changes: 2 additions & 2 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func addAuthLookup() {
AddFuncLookup("username", Info{
Display: "Username",
Category: "auth",
Description: "Generates a random username",
Description: "Unique identifier assigned to a user for accessing an account or system",
Example: "Daniel1364",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -117,7 +117,7 @@ func addAuthLookup() {
AddFuncLookup("password", Info{
Display: "Password",
Category: "auth",
Description: "Generates a random password",
Description: "Secret word or phrase used to authenticate access to a system or account",
Example: "EEP+wwpk 4lU-eHNXlJZ4n K9%v&TZ9e",
Output: "string",
Params: []Param{
Expand Down
16 changes: 8 additions & 8 deletions beer.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func addBeerLookup() {
AddFuncLookup("beername", Info{
Display: "Beer Name",
Category: "beer",
Description: "Name for a beer, inspired by real beer names",
Description: "Specific brand or variety of beer",
Example: "Duvel",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -132,7 +132,7 @@ func addBeerLookup() {
AddFuncLookup("beerstyle", Info{
Display: "Beer Style",
Category: "beer",
Description: "Style of beer, covering beer types from around the world",
Description: "Distinct characteristics and flavors of beer",
Example: "European Amber Lager",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -143,7 +143,7 @@ func addBeerLookup() {
AddFuncLookup("beerhop", Info{
Display: "Beer Hop",
Category: "beer",
Description: "Beer hop variety, covering different hop types used in brewing",
Description: "The flower used in brewing to add flavor, aroma, and bitterness to beer",
Example: "Glacier",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -154,7 +154,7 @@ func addBeerLookup() {
AddFuncLookup("beeryeast", Info{
Display: "Beer Yeast",
Category: "beer",
Description: "Beer yeast, covering various yeast strains used in beer fermentation",
Description: "Microorganism used in brewing to ferment sugars, producing alcohol and carbonation in beer",
Example: "1388 - Belgian Strong Ale",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -165,7 +165,7 @@ func addBeerLookup() {
AddFuncLookup("beermalt", Info{
Display: "Beer Malt",
Category: "beer",
Description: "Beer malt, covering various malt types used in the brewing process",
Description: "Processed barley or other grains, provides sugars for fermentation and flavor to beer",
Example: "Munich",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -176,7 +176,7 @@ func addBeerLookup() {
AddFuncLookup("beeralcohol", Info{
Display: "Beer Alcohol",
Category: "beer",
Description: "Alcohol percentage",
Description: "Measures the alcohol content in beer",
Example: "2.7%",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -187,7 +187,7 @@ func addBeerLookup() {
AddFuncLookup("beeribu", Info{
Display: "Beer IBU",
Category: "beer",
Description: "International Bitterness Unit (IBU) value, indicating the bitterness level in beer",
Description: "Scale measuring bitterness of beer from hops",
Example: "29 IBU",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -198,7 +198,7 @@ func addBeerLookup() {
AddFuncLookup("beerblg", Info{
Display: "Beer BLG",
Category: "beer",
Description: "Generates a random beer Balling (°Blg) value, representing the beer's original gravity or sugar content",
Description: "Scale indicating the concentration of extract in worts",
Example: "6.4°Blg",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
8 changes: 4 additions & 4 deletions book.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func addBookLookup() {
AddFuncLookup("book", Info{
Display: "Book",
Category: "book",
Description: "Generates a comprehensive book dataset, including title, author, and genre",
Description: "Written or printed work consisting of pages bound together, covering various subjects or stories",
Example: `{
"title": "Anna Karenina",
"author": "Toni Morrison",
Expand All @@ -58,7 +58,7 @@ func addBookLookup() {
AddFuncLookup("booktitle", Info{
Display: "Title",
Category: "book",
Description: "Generates a book title from a diverse range of genres and periods",
Description: "The specific name given to a book",
Example: "Hamlet",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -69,7 +69,7 @@ func addBookLookup() {
AddFuncLookup("bookauthor", Info{
Display: "Author",
Category: "book",
Description: "Generates the name of a book author from various times and places",
Description: "The individual who wrote or created the content of a book",
Example: "Mark Twain",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -80,7 +80,7 @@ func addBookLookup() {
AddFuncLookup("bookgenre", Info{
Display: "Genre",
Category: "book",
Description: "Generates a genre from a wide range of book categories",
Description: "Category or type of book defined by its content, style, or form",
Example: "Adventure",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
12 changes: 6 additions & 6 deletions car.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func addCarLookup() {
AddFuncLookup("car", Info{
Display: "Car",
Category: "car",
Description: "Complete set of car data including essential information like type, fuel type, transmission, brand, model, and production year of a vehicle",
Description: "Wheeled motor vehicle used for transportation",
Example: `{
"type": "Passenger car mini",
"fuel": "Gasoline",
Expand All @@ -94,7 +94,7 @@ func addCarLookup() {
AddFuncLookup("cartype", Info{
Display: "Car Type",
Category: "car",
Description: "Category of vehicle, like sedan, SUV, truck, or sports car, based on design",
Description: "Classification of cars based on size, use, or body style",
Example: "Passenger car mini",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -105,7 +105,7 @@ func addCarLookup() {
AddFuncLookup("carfueltype", Info{
Display: "Car Fuel Type",
Category: "car",
Description: "Type of energy source for vehicles, such as gasoline, diesel, electric, or hybrid",
Description: "Type of energy source a car uses",
Example: "CNG",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -116,7 +116,7 @@ func addCarLookup() {
AddFuncLookup("cartransmissiontype", Info{
Display: "Car Transmission Type",
Category: "car",
Description: "Mechanism controlling vehicle's power, like manual, automatic, etc.",
Description: "Mechanism a car uses to transmit power from the engine to the wheels",
Example: "Manual",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -127,7 +127,7 @@ func addCarLookup() {
AddFuncLookup("carmaker", Info{
Display: "Car Maker",
Category: "car",
Description: "Company name specializing in designing, manufacturing, and selling cars",
Description: "Company or brand that manufactures and designs cars",
Example: "Nissan",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand All @@ -138,7 +138,7 @@ func addCarLookup() {
AddFuncLookup("carmodel", Info{
Display: "Car Model",
Category: "car",
Description: "Specific design or version of a vehicle produced by a car manufacturer",
Description: "Specific design or version of a car produced by a manufacturer",
Example: "Aveo",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
Expand Down
8 changes: 4 additions & 4 deletions cmd/gofakeit/gofakeit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"errors"
"io/ioutil"
"io"
"os"
"strings"
"testing"
Expand All @@ -22,7 +22,7 @@ func TestMain(t *testing.T) {
main()

w.Close()
out, _ := ioutil.ReadAll(r)
out, _ := io.ReadAll(r)
os.Stdout = rescueStdout

// Get output string
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestFunctionLoop(t *testing.T) {
main()

w.Close()
out, _ := ioutil.ReadAll(r)
out, _ := io.ReadAll(r)
os.Stdout = rescueStdout

// Get output string
Expand Down Expand Up @@ -211,7 +211,7 @@ func TestListCategoryFunction(t *testing.T) {
outStr = strings.ToLower(outStr)

// Make sure outStr contains random noun
if !strings.Contains(outStr, "random noun") {
if !strings.Contains(outStr, "noun") {
t.Errorf("list category function output does not contain random noun")
}
}
4 changes: 4 additions & 0 deletions data/word.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var Word = map[string][]string{
"noun_collective_thing": {"wad", "pair", "album", "string", "anthology", "reel", "outfit", "fleet", "comb", "archipelago", "quiver", "bale", "packet", "hedge", "basket", "orchard", "batch", "library", "battery", "set", "harvest", "block", "forest", "book", "group", "bouquet", "collection", "bowl", "stack", "bunch", "hand", "bundle", "catalog", "shower", "ream", "chest", "heap", "range", "cluster", "pack", "hail", "cloud", "galaxy", "sheaf", "clump"},
"noun_countable": {"camp", "hospital", "shirt", "sock", "plant", "cup", "fork", "spoon", "plate", "straw", "town", "box", "bird", "father", "answer", "egg", "purse", "mirror", "mistake", "toilet", "toothbrush", "shower", "towel", "pool", "corner", "card", "lawn", "city", "egg", "yard", "burger", "kilometer", "mile", "father", "film", "actor", "issue", "machine", "liter", "room", "station", "journey", "castle", "hour", "finger", "boy", "book", "year", "second", "son", "month", "group", "hall", "cat", "week", "picture", "day", "village", "effect", "baby", "weekend", "class", "meal", "river", "grade", "bush", "desk", "stream", "method", "brother", "sister", "factory", "aunt", "bush", "program", "uncle", "ball", "cousin", "wall", "grandmother", "cup", "grandfather", "week", "school", "shirt", "child", "king", "road", "judge", "bridge", "car", "line", "book", "eye", "teacher", "foot", "party", "face", "day", "chest", "handle", "week", "hotel", "eye", "animal", "doctor", "adult", "village", "key", "bird", "bank", "program", "idea", "gun", "card", "brother", "dress", "room", "door", "mouth", "club", "game", "ring", "project", "sister", "road", "coat", "account", "group", "cigarette", "farm", "river", "college", "computer", "walk", "corner", "cat", "head", "street", "election", "country", "chair", "crowd", "cup", "plant", "farm", "handle", "model", "book", "message", "battle", "pen", "pencil", "elephant", "carrot", "onion", "garden", "country", "engine", "bill", "apple", "noun", "club", "crowd", "window", "field", "friend", "verb", "class", "flower", "seed", "lake", "plant", "animal", "ocean", "whale", "fish", "stream", "cloud", "couch", "steak", "problem", "light", "door", "room", "painting", "shop", "apartment", "candle", "adult", "building", "plan", "page", "ball", "game", "animal", "apartment", "box", "thought", "walk", "lady", "bottle", "article", "game", "kettle", "car", "house", "hoses", "orange", "phone", "app", "window", "door", "dollar", "foot", "cent", "library", "cat", "bed", "pound", "gate", "tomatoes", "gun", "holiday", "woman", "job", "shock", "salary", "tax", "coat", "scooter", "dog", "problem", "field", "answer", "ear", "camp", "case", "road", "woman", "product", "bridge", "man", "dream", "idea", "scheme", "invention", "cigarette", "mother", "friend", "chapter", "computer", "dream", "father", "child", "motor", "deskpath", "factory", "park", "newspaper", "hat", "dream", "table", "kitchen", "student", "captain", "doctor", "bus", "neck", "class", "list", "member", "chest", "valley", "product", "horse", "captain", "star", "hour", "page", "bus", "girl", "month", "child", "house", "boy", "bill", "kitchen", "chapter", "boat", "hand", "dress", "table", "wall", "chair", "train", "minute", "magazine", "bus", "party", "bird", "lake", "job", "nation", "bike", "election", "hand", "box", "beach", "address", "project", "task", "park", "face", "college", "bell", "plane", "store", "hall", "accident", "daughter", "ship", "candy", "smile", "city", "island", "case", "spot", "film", "husband", "artist", "tour", "bag", "boat", "driver", "office", "chair", "path", "dog", "bag", "finger", "apartment", "garden", "heart", "year", "engine", "girl", "day", "castle", "plane", "ring", "brother", "edge", "picture", "meeting", "tent", "dog", "hat", "head", "bottle", "hill"},
"noun_uncountable": {"accommodation", "advertising", "air", "aid", "advice", "anger", "art", "assistance", "bread", "business", "butter", "calm", "cash", "chaos", "cheese", "childhood", "clothing", "coffee", "content", "corruption", "courage", "currency", "damage", "danger", "darkness", "data", "determination", "economics", "education", "electricity", "employment", "energy", "entertainment", "enthusiasm", "equipment", "evidence", "failure", "fame", "fire", "flour", "food", "freedom", "friendship", "fuel", "furniture", "fun", "genetics", "gold", "grammar", "guilt", "hair", "happiness", "harm", "health", "heat", "help", "homework", "honesty", "hospitality", "housework", "humour", "imagination", "importance", "information", "innocence", "intelligence", "jealousy", "juice", "justice", "kindness", "knowledge", "labour", "lack", "laughter", "leisure", "literature", "litter", "logic", "love", "luck", "magic", "management", "metal", "milk", "money", "motherhood", "motivation", "music", "nature", "news", "nutrition", "obesity", "oil", "old age", "oxygen", "paper", "patience", "permission", "pollution", "poverty", "power", "pride", "production", "progress", "pronunciation", "publicity", "punctuation", "quality", "quantity", "racism", "rain", "relaxation", "research", "respect", "rice", "room (space)", "rubbish", "safety", "salt", "sand", "seafood", "shopping", "silence", "smoke", "snow", "software", "soup", "speed", "spelling", "stress", "sugar", "sunshine", "tea", "tennis", "time", "tolerance", "trade", "traffic", "transportation", "travel", "trust", "understanding", "unemployment", "usage", "violence", "vision", "warmth", "water", "wealth", "weather", "weight", "welfare", "wheat", "width", "wildlife", "wisdom", "wood", "work", "yoga", "youth"},
"noun_determiner": {"the", "a", "an", "this", "that", "these", "those", "my", "your", "his", "her", "its", "our", "their", "some", "any", "each", "every", "certain"},
//"noun_proper": {}, // This refers to an actual person(John Doe), place(Chipotle, Tennessee)

// Verbs
Expand Down Expand Up @@ -76,4 +77,7 @@ var Word = map[string][]string{
"connective_listing": {"firstly", "secondly", "first of all", "finally", "lastly", "for one thing", "for another", "in the first place", "to begin with", "next", "in summation", "to conclude"},
"connective_casual": {"accordingly", "all the same", "an effect of", "an outcome of", "an upshot of", "as a consequence of", "as a result of", "because", "caused by", "consequently", "despite this", "even though", "hence", "however", "in that case", "moreover", "nevertheless", "otherwise", "so", "so as", "stemmed from", "still", "then", "therefore", "though", "under the circumstances", "yet"},
"connective_examplify": {"accordingly", "as a result", "as exemplified by", "consequently", "for example", "for instance", "for one thing", "including", "provided that", "since", "so", "such as", "then", "therefore", "these include", "through", "unless", "without"},

// Misc
"interjection": {"wow", "hey", "oops", "ouch", "yay", "aha", "eek", "huh", "hmm", "whoa", "yikes", "phew", "gee", "alas", "bravo"},
}
28 changes: 14 additions & 14 deletions generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ func ExampleGenerate() {
fmt.Println(Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}"))

// Output: Markus Moen ssn is 526643139 and lives at 599 Daleton
// Niche backwards caused.
// [1 3 2]
// -4
// 3
// 46
// [a:b int:string key:value 1:2]
// Congolese choir computer.
// [3 1 2]
// 2
// 4
// 17
// [int:string 1:2 a:b key:value]
}

func ExampleFaker_Generate() {
Expand All @@ -71,12 +71,12 @@ func ExampleFaker_Generate() {
fmt.Println(f.Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}"))

// Output: Markus Moen ssn is 526643139 and lives at 599 Daleton
// Niche backwards caused.
// [1 3 2]
// -4
// 3
// 46
// [a:b int:string key:value 1:2]
// Congolese choir computer.
// [3 1 2]
// 2
// 4
// 17
// [int:string 1:2 a:b key:value]
}

func BenchmarkGenerate(b *testing.B) {
Expand Down Expand Up @@ -480,14 +480,14 @@ func ExampleMap() {
Seed(11)
fmt.Println(Map())

// Output: map[contrast:Associate gauva:map[jump:scale] generally:8504801 him:[them whomever ours hence here his] its:8335564 table:map[did:[these delay these]] therefore:map[nearly:784141.8] thing:map[everything:[where caused why week hourly]]]
// Output: map[here:Manager herself:map[trip:[far computer was unless whom riches]] how:8504801 ouch:Keith Ullrich outstanding:1860846 that:web services]
}

func ExampleFaker_Map() {
f := New(11)
fmt.Println(f.Map())

// Output: map[contrast:Associate gauva:map[jump:scale] generally:8504801 him:[them whomever ours hence here his] its:8335564 table:map[did:[these delay these]] therefore:map[nearly:784141.8] thing:map[everything:[where caused why week hourly]]]
// Output: map[here:Manager herself:map[trip:[far computer was unless whom riches]] how:8504801 ouch:Keith Ullrich outstanding:1860846 that:web services]
}

func TestMap(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func initLookup() {
addWordPronounLookup()
addWordSentenceLookup()
addWordVerbLookup()
addWordCommentLookup()
addWordMiscLookup()
}

// internalFuncLookups is the internal map array with mapping to all available data
Expand Down
Loading

0 comments on commit a5e6a89

Please sign in to comment.