Skip to content

Commit

Permalink
Add experimental pass
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Feb 10, 2024
1 parent de67d71 commit 5ac3b8a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions monorepo/DocumentationIntelligence/DocumentationIntelligence.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,17 @@ public function createPrunedModel(): void
}
$model = $uniqueLines;

// Pass where we move single word-lines to a new line
$aloneWords = [];
foreach ($model as $index => $line) {
if ((str_word_count($line) === 1) && (! Str::startsWith($line, '- '))) {
$aloneWords[] = $line;
unset($model[$index]);
}
}
$imploded = implode('. ', $aloneWords);
$model[] = "\n".$imploded;

$model = implode("\n", $model);

// Remove multiple newlines
Expand Down

0 comments on commit 5ac3b8a

Please sign in to comment.