In[]:=
haiku="Over the wintry\nForest, winds howl in rage\nWith no leaves to blow.";
words=TextWords[haiku];​​wordparts=PartOfSpeech/@words
Out[]=

noun
,
adjective
,
adverb
,
preposition
,
determiner
,
adjective
,
noun
,
verb
,
noun
,
verb
,
noun
,
verb
,
noun
,
adjective
,
adverb
,
preposition
,
noun
,
verb
,
preposition
,
noun
,
adjective
,
adverb
,
determiner
,
noun
,
verb
,
preposition
,
noun
,
verb

Transpose@{words,​​Length/@ResourceFunction["WordSyllables"]/@words,​​Extract[wordparts,​​Transpose@{Range@Length@wordparts,{-1,1,1,1,1,2,-1,1,​​1,-1,1,1,2}}]}//TableForm
Out[]//TableForm=
Over
2
preposition
the
1
determiner
wintry
2
adjective
Forest
2
noun
winds
1
noun
howl
1
verb
in
1
preposition
rage
1
noun
With
1
preposition
no
1
determiner
leaves
1
noun
to
1
preposition
blow
1
verb
In[]:=
haikudata=
"Over"
2
preposition
GRAMMATICAL UNIT
Capitalize
"the"
1
determiner
GRAMMATICAL UNIT
"the"&
"wintry"
2
adjective
GRAMMATICAL UNIT
Identity
"Forest"
2
noun
GRAMMATICAL UNIT
Capitalize
"winds"
1
noun
GRAMMATICAL UNIT
Pluralize
"howl"
2
verb
GRAMMATICAL UNIT
Identity
"in"
1
preposition
GRAMMATICAL UNIT
Identity
"rage"
1
noun
GRAMMATICAL UNIT
Identity
"With"
1
preposition
GRAMMATICAL UNIT
Capitalize
"no"
1
determiner
GRAMMATICAL UNIT
Identity
"leaves"
1
noun
GRAMMATICAL UNIT
Pluralize
"to"
1
preposition
GRAMMATICAL UNIT
"to"&
"blow"
1
verb
GRAMMATICAL UNIT
Identity
//Transpose;
In[]:=
randomNSyllableWord[n_,type_]:=​​Module[{newword,iter=0},​​newword=RandomWord[type];​​While[​​Length@ResourceFunction["WordSyllables"]@newword≠n&&iter<10,​​newword=RandomWord[type]​​];​​newword];
StringReplace[haiku,MapThread[​​Function[{word,syl,POS,transform}​​,wordIf[MatchQ[transform,_Function],transform[],transform@randomNSyllableWord[syl,POS]]]​​,haikudata]]
Out[]=
Outside the duskyKickoff, blokes instill thru blipThwart our torches to swarm.