From d5535a38adf0302b50a4e97a189e4580f661d480 Mon Sep 17 00:00:00 2001 From: rootiest Date: Sun, 2 Aug 2026 05:37:06 -0400 Subject: [PATCH] feat: add verb dictionary and preserve literal string casing in rand_string --- data/words/verb.txt | 1000 ++++++++++++++++++++++++++++++++++++ functions/rand_string.fish | 28 +- 2 files changed, 1016 insertions(+), 12 deletions(-) create mode 100644 data/words/verb.txt diff --git a/data/words/verb.txt b/data/words/verb.txt new file mode 100644 index 0000000..cb3b63d --- /dev/null +++ b/data/words/verb.txt @@ -0,0 +1,1000 @@ +abandoned +accept +accepted +accompanied +accomplished +according +account +accused +achieve +achieved +acquire +acquired +act +acted +acting +adapted +add +added +adding +address +addressed +adds +administered +admit +admitted +adopt +adopted +advanced +affect +affected +affecting +affects +afford +agree +agreed +aimed +allow +allowed +allowing +allows +altered +announced +answer +answered +appear +appeared +appears +applied +applies +apply +applying +appointed +appreciate +approached +approved +are +argue +argued +argues +arise +arises +arising +arranged +arrested +arrive +arrived +ask +asked +asking +asks +assess +assigned +assist +associated +assume +assumed +assuming +assured +attached +attacked +attempt +attempted +attempting +attend +attended +attracted +attributed +avoid +avoided +based +bear +bearing +became +become +becomes +becoming +been +began +begin +beginning +begins +begun +being +believe +believed +believes +belong +belonging +belongs +born +bought +bound +break +breaking +bring +bringing +brings +broke +broken +brought +build +building +built +buried +burning +buy +calculated +call +called +calling +calls +came +can +captured +care +carried +carry +carrying +cast +catch +caught +cause +caused +causes +causing +change +changed +changing +characterized +charged +check +checked +choose +chose +chosen +cited +claim +claimed +classified +click +close +closed +collect +collected +combined +come +comes +coming +committed +communicate +compare +compared +complete +completed +composed +conceived +concerned +concerning +conclude +concluded +conducted +confined +confirmed +connected +consider +considered +considering +consist +consisted +consisting +consists +constitute +constituted +constitutes +construct +constructed +contain +contained +containing +contains +continue +continued +continues +continuing +contribute +contributed +control +controlled +converted +convinced +cost +could +cover +covered +covering +create +created +creates +creating +cried +crossed +cut +cutting +dated +deal +dealing +dealt +decide +decided +declared +decreased +dedicated +defend +define +defined +defining +deliver +delivered +demanded +demonstrate +demonstrated +denied +deny +depend +depending +depends +derived +describe +described +describes +describing +designated +designed +desired +destroy +destroyed +detected +determine +determined +determining +develop +developed +developing +devoted +did +die +died +differ +directed +disappeared +discover +discovered +discuss +discussed +discussing +display +displayed +distinguish +distinguished +distributed +divided +does +doing +dominated +done +draw +drawing +drawn +dressed +drew +drink +drive +driven +driving +dropped +drove +dying +earned +eat +eating +edited +educated +elected +eliminate +emerged +emerging +emphasized +employed +enable +enabled +encountered +encourage +encouraged +end +ended +ending +ends +engage +engaged +enjoy +enjoyed +ensure +enter +entered +entering +entitled +escape +establish +established +establishing +estimated +evaluate +examine +examined +excluded +executed +exercise +exist +existed +existing +exists +expand +expanded +expect +expected +experience +experienced +explain +explained +explains +explore +exposed +express +expressed +extend +extended +extending +face +faced +facilitate +facing +fail +failed +fails +fall +fallen +falling +falls +fed +feel +feeling +feels +fell +felt +fight +fighting +filed +fill +filled +find +finding +finds +finished +fit +fixed +flying +focus +focused +follow +followed +following +follows +force +forced +forget +forgotten +form +formed +forming +fought +found +founded +gain +gained +gathered +gave +generate +generated +get +gets +getting +give +given +gives +giving +goes +going +gone +got +granted +grew +grow +growing +grown +guess +had +handed +handle +happen +happened +happening +happens +has +have +having +headed +hear +heard +hearing +held +help +helped +helping +helps +hit +hold +holding +holds +hope +hoped +hung +hurt +ibid +identified +identify +identifying +ignored +illustrate +illustrated +illustrates +imagine +implemented +implies +imposed +improve +improved +improving +include +included +includes +including +incorporated +increase +increased +increasing +indicate +indicated +indicates +indicating +induced +influence +influenced +informed +initiated +insisted +inspired +intended +interpreted +introduce +introduced +invited +involve +involved +involves +involving +issued +join +joined +justified +justify +keep +keeping +kept +kill +killed +knew +know +knowing +known +knows +lacking +laid +laughed +lay +lead +leading +leads +learn +learned +learning +leave +leaves +leaving +led +left +let +lie +lies +lifted +like +liked +limit +limited +linked +listed +listen +listening +live +lived +lives +living +located +look +looked +looking +looks +lose +losing +lost +love +loved +lying +made +maintain +maintained +maintaining +make +makes +making +manage +managed +marked +married +marry +may +mean +meaning +means +meant +measure +measured +measuring +med +meet +meeting +mention +mentioned +met +might +mind +missing +modified +mounted +move +moved +moves +moving +must +name +named +need +needed +needs +nodded +note +noted +notice +noticed +observe +observed +obtain +obtained +obtaining +occupied +occur +occurred +occurring +occurs +offer +offered +offering +offers +open +opened +opening +operate +operated +operating +opposed +ordered +organized +ought +overcome +owned +paid +painted +participate +pass +passed +passes +passing +pay +paying +perceived +perform +performed +performing +permit +permitted +pick +picked +place +placed +planned +planning +play +played +playing +plays +please +pleased +point +pointed +possess +possessed +pour +preceding +predicted +prefer +preferred +prepare +prepared +preparing +present +presented +presents +preserve +preserved +pressed +prevent +prevented +printed +proceed +produce +produced +produces +producing +promised +promote +proposed +protect +protected +prove +proved +provide +provided +provides +providing +published +pull +pulled +purchased +pursue +pushed +put +puts +putting +quoted +raise +raised +raising +ran +reach +reached +reaching +read +reading +realize +realized +recall +recalled +receive +received +receives +receiving +recognize +recognized +recommended +recorded +reduce +reduced +reducing +refer +referred +referring +refers +reflect +reflected +reflects +refused +regard +regarded +regarding +rejected +relate +related +relating +released +rely +remain +remained +remaining +remains +remember +remembered +remove +removed +rendered +repeated +replace +replaced +replied +report +reported +represent +represented +representing +represents +reprinted +requested +require +required +requires +requiring +reserved +resist +resolved +respond +responded +rest +restricted +result +resulted +resulting +retain +retained +return +returned +returning +reveal +revealed +reveals +revised +rise +rising +rose +ruled +run +running +runs +said +sat +satisfied +satisfy +save +saved +saw +say +saying +says +secure +see +seeing +seek +seeking +seem +seemed +seems +seen +sees +select +selected +sell +selling +send +sending +sent +separated +serve +served +serves +serving +set +setting +settle +settled +shall +share +shared +sharing +shook +shot +should +show +showed +showing +shown +shows +shut +signed +sit +sitting +situated +sleep +smiled +sold +solve +solving +sought +speak +speaking +speaks +specified +spend +spent +spoke +spoken +spread +stand +standing +stands +stared +start +started +starting +starts +state +stated +stay +stayed +stepped +stood +stop +stopped +stored +struck +studied +study +studying +submitted +succeed +succeeded +suffer +suffered +suffering +suggest +suggested +suggesting +suggests +supplied +supply +support +supported +supporting +suppose +supposed +surprised +surrounded +surrounding +survive +take +taken +takes +taking +talk +talked +talking +taught +teach +teaching +tell +telling +tells +tend +tended +tends +test +tested +thank +think +thinking +thinks +thought +threatened +threw +throw +thrown +tied +told +took +touch +touched +trained +transferred +transformed +translated +transmitted +travel +treat +treated +tried +try +trying +turn +turned +turning +turns +understand +understanding +understood +undertaken +urged +use +used +uses +using +varies +vary +varying +view +viewed +visit +visited +wait +waited +waiting +walk +walked +walking +want +wanted +wants +was +watch +watched +watching +wear +wearing +went +were +will +win +wish +wished +won +wonder +wondered +wore +work +worked +working +works +worry +would +write +writes +writing +written +wrote +yield diff --git a/functions/rand_string.fish b/functions/rand_string.fish index 7f7d468..7f4d588 100644 --- a/functions/rand_string.fish +++ b/functions/rand_string.fish @@ -16,9 +16,9 @@ # apply only to the components that follow them. # # Supported Components: -# A bundled word list (e.g. adjective, animal, color, name, noun) +# A bundled word list (e.g. adjective, animal, color, name, noun, verb) # digits= N random digits (e.g. digits=3 -> 842) -# literal= A literal string component +# literal= A static string component (e.g. literal=TEST) # # ARGUMENTS # -s, --separator= Delimiter for subsequent words (dash, underscore, dot, none, or literal chars) @@ -32,6 +32,7 @@ # EXAMPLE # rand_string adjective animal # rand_string --case=title color animal --separator=dot digits=4 +# rand_string literal=TEST --separator=underscore verb noun # # NOTES # Falls back to `random choice` if GNU `shuf` is missing, but `shuf` is @@ -49,9 +50,9 @@ function rand_string --description 'Generate random, memorable strings from cura echo " Generate random, memorable strings from curated word databases." echo echo "$c_head""Components:$c_rst" - echo " $c_arg$c_rst A bundled word list (e.g. adjective, animal, color, name, noun)" + echo " $c_arg$c_rst A bundled word list (e.g. adjective, animal, color, name, noun, verb)" echo " $c_arg""digits=$c_rst N random digits (e.g. digits=3 -> 842)" - echo " $c_arg""literal=$c_rst A literal string component" + echo " $c_arg""literal=$c_rst A static string component for prefixes/suffixes (e.g. literal=TEST)" echo echo "$c_head""Modifiers:$c_rst" echo " $c_flag-s$c_rst, $c_flag--separator=$c_rst Delimiter for subsequent words (dash, underscore, dot, none)" @@ -61,6 +62,7 @@ function rand_string --description 'Generate random, memorable strings from cura echo "$c_head""Examples:$c_rst" echo " $c_cmd""rand_string$c_rst adjective animal" echo " $c_cmd""rand_string$c_rst --case=title color animal --separator=dot digits=4" + echo " $c_cmd""rand_string$c_rst literal=TEST --separator=underscore verb noun" return 0 end @@ -155,14 +157,16 @@ function rand_string --description 'Generate random, memorable strings from cura end end - # 4. Apply casing - switch $casing - case upper - set part (string upper $part) - case lower - set part (string lower $part) - case title - set part (string replace -r '^(.)' '\U$1' (string lower $part)) + # 4. Apply casing (skip for literal text) + if not string match -q 'literal=*' -- $arg; and not string match -q 'string=*' -- $arg + switch $casing + case upper + set part (string upper $part) + case lower + set part (string lower $part) + case title + set part (string replace -r '^(.)' '\U$1' (string lower $part)) + end end # 5. Append to result