Factorize the code that parses the output of aspell
This commit is contained in:
parent
ffde7e4787
commit
5c189887e0
|
@ -16,15 +16,11 @@ def spell %{
|
|||
while read line; do
|
||||
case $line in
|
||||
\&*)
|
||||
word=$(printf %s "$line" | cut -d ' ' -f 2)
|
||||
begin=$(printf %s "$line" | cut -d ' ' -f 4 | sed 's/:$//')
|
||||
end=$((begin + ${#word}))
|
||||
# echo "echo -debug -- line: $line_num, word: $word, begin: $begin, end: $end"
|
||||
regions="$regions:$line_num.$begin,$line_num.$end|Error"
|
||||
;;
|
||||
;&
|
||||
'#'*)
|
||||
word=$(printf %s "$line" | cut -d ' ' -f 2)
|
||||
begin=$(printf %s "$line" | cut -d ' ' -f 3)
|
||||
begin=${begin:-$(printf %s "$line" | cut -d ' ' -f 3)}
|
||||
end=$((begin + ${#word}))
|
||||
# echo "echo -debug -- line: $line_num, word: $word, begin: $begin, end: $end"
|
||||
regions="$regions:$line_num.$begin,$line_num.$end|Error"
|
||||
|
|
Loading…
Reference in New Issue
Block a user