Sponsored Content
Full Discussion: Writing a script for aspell
Homework and Emergencies Homework & Coursework Questions Writing a script for aspell Post 302865891 by gamernerd101 on Sunday 20th of October 2013 10:38:25 AM
Old 10-20-2013
Thanks so much, that makes much more sense. However, I'm still getting the same problems. I've tried multiple different variants of my loop. It seems to me that I may be storing it wrong? Maybe I am still trying to loop through the arrays wrong but here's what else I tried and has only accessed the first string of misspelled words. (Along with this one.)

Code:
for i in "${uncorrect[@]}"; do
for j in "${reSpell[@]}"; do
printf $i "" $j

This did not access the strings I believe I stored in the corresponding arrays, so maybe my problem is storage. Thanks again.

Code:
#! /bin/bash

reSpell=()
uncorrect=()
# now check the spellings
let count=1

check=(`aspell list -p ~/.checked < $1`)
# for each mispelled word in the file is entered into i and put into the new directory memory if corrected
for i in ${check[*]} ; do
   uncorrect[$count]=$i
   read -p "$i is mispelled. Press \"Enter\" to keep this spelling or type your new spelling here: " newSpell

   # unfixed spellings are ignored and not replaced and are left where they are in the fiexedspell array
if [ "$newSpell"="" ]; then
   echo $i>> ~/.memory

else
   reSpell[$count]=$newSpell
fi
   count=$((count+1))
   echo ""

done


printf "MISPELLED %20s\n" CORRECTIONS
echo ""
for (( i=0; i<${#uncorrect[*]}; i++));  do
printf "${uncorrect[$i]} %-20s%s\n" ${reSpell[$i]}

done

 

2 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

redirecting the output of aspell

Hi, I have 2 identical servers both running aspell but for some reason I can't redirect the output to a file on one of them. This is what I'm trying to do: echo feck | aspell -l > errors.txt On one machine this works fine but the other it doesn't (the file is created but it is empty). ... (6 Replies)
Discussion started by: leekb
6 Replies

2. UNIX for Dummies Questions & Answers

Trouble getting aspell to work

Hi: I've tried to get aspell to work to check a latex document I have. I get this error message: Error: No word lists can be found for the language "en_CA". Can anyone offer any suggestions? I'm trying to get a good spell-checker set up for my latex documents. Excalibur does not work all... (1 Reply)
Discussion started by: spindoctor
1 Replies
ENCHANT_BROKER_LIST_DICTS(3)						 1					      ENCHANT_BROKER_LIST_DICTS(3)

enchant_broker_list_dicts - Returns a list of available dictionaries

SYNOPSIS
mixed enchant_broker_list_dicts (resource $broker) DESCRIPTION
Returns a list of available dictionaries with their details. PARAMETERS
o $broker - Broker resource RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 List all available dictionaries for one broker <?php $r = enchant_broker_init(); $dicts = enchant_broker_list_dicts($r); print_r($dicts); ?> The above example will output something similar to: Array ( [0] => Array ( [lang_tag] => de [provider_name] => aspell [provider_desc] => Aspell Provider [provider_file] => /usr/lib/enchant/libenchant_aspell.so ) [1] => Array ( [lang_tag] => de_DE [provider_name] => aspell [provider_desc] => Aspell Provider [provider_file] => /usr/lib/enchant/libenchant_aspell.so ) [3] => Array ( [lang_tag] => en [provider_name] => aspell [provider_desc] => Aspell Provider [provider_file] => /usr/lib/enchant/libenchant_aspell.so ) [4] => Array ( [lang_tag] => en_GB [provider_name] => aspell [provider_desc] => Aspell Provider [provider_file] => /usr/lib/enchant/libenchant_aspell.so ) [5] => Array ( [lang_tag] => en_US [provider_name] => aspell [provider_desc] => Aspell Provider [provider_file] => /usr/lib/enchant/libenchant_aspell.so ) [6] => Array ( [lang_tag] => hi_IN [provider_name] => myspell [provider_desc] => Myspell Provider [provider_file] => /usr/lib/enchant/libenchant_myspell.so ) ) SEE ALSO
enchant_broker_describe(3). PHP Documentation Group ENCHANT_BROKER_LIST_DICTS(3)
All times are GMT -4. The time now is 01:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy