From 631830d1f1ee5b9799e7682bd7d752e8852b8103 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Thu, 19 Jan 2023 23:00:43 +0100 Subject: [PATCH] README: simplify cmudict cleanup code Perl "split" without arguments takes care of whitespace cleanup. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index d4a48ea..f245490 100644 --- a/README.md +++ b/README.md @@ -108,8 +108,7 @@ $ wget https://raw.githubusercontent.com/cmusphinx/cmudict/master/cmudict.dict # Clean it up a bit and reformat: $ cat cmudict.dict \ | perl -pe 's/\([0-9]+\)//; - s/\s+/ /g; s/^\s+//; - s/\s+$//; @_ = split (/\s+/); + @_ = split; $w = shift (@_); $_ = $w."\t".join (" ", @_)."\n";' \ > cmudict.formatted.dict