Minor changelog updates
[pidgin-git.git] / pidgin / plugins / spellchk.c
blob0fdfcf88a41ee4ebd5e864f319f69d4259386d7b
1 /*
2 * Purple - Replace certain misspelled words with their correct form.
4 * Signification changes were made by Benjamin Kahn ("xkahn") and
5 * Richard Laager ("rlaager") in April 2005--you may want to contact
6 * them if you have questions.
8 * Pidgin is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
29 * A lot of this code (especially the config code) was taken directly
30 * or nearly directly from xchat, version 1.4.2 by Peter Zelezny and others.
33 #include "internal.h"
34 #include "pidgin.h"
36 #include "debug.h"
37 #include "notify.h"
38 #include "signals.h"
39 #include "util.h"
40 #include "version.h"
42 #include "gtkplugin.h"
43 #include "gtkprefs.h"
44 #include "gtkutils.h"
46 #include <stdio.h>
47 #include <string.h>
48 #include <sys/types.h>
49 #include <sys/stat.h>
51 #define SPELLCHECK_PLUGIN_ID "gtk-spellcheck"
52 #define SPELLCHK_OBJECT_KEY "spellchk"
54 enum {
55 BAD_COLUMN,
56 GOOD_COLUMN,
57 WORD_ONLY_COLUMN,
58 CASE_SENSITIVE_COLUMN,
59 N_COLUMNS
62 struct _spellchk {
63 GtkTextView *view;
64 GtkTextMark *mark_insert_start;
65 GtkTextMark *mark_insert_end;
67 const gchar *word;
68 gboolean inserting;
69 gboolean ignore_correction;
70 gboolean ignore_correction_on_send;
71 gint pos;
74 typedef struct _spellchk spellchk;
76 static GtkListStore *model;
78 static gboolean
79 is_word_uppercase(const gchar *word)
81 for (; word[0] != '\0'; word = g_utf8_find_next_char (word, NULL)) {
82 gunichar c = g_utf8_get_char(word);
84 if (!(g_unichar_isupper(c) ||
85 g_unichar_ispunct(c) ||
86 g_unichar_isspace(c)))
87 return FALSE;
90 return TRUE;
93 static gboolean
94 is_word_lowercase(const gchar *word)
96 for (; word[0] != '\0'; word = g_utf8_find_next_char(word, NULL)) {
97 gunichar c = g_utf8_get_char(word);
99 if (!(g_unichar_islower(c) ||
100 g_unichar_ispunct(c) ||
101 g_unichar_isspace(c)))
102 return FALSE;
105 return TRUE;
108 static gboolean
109 is_word_proper(const gchar *word)
111 if (word[0] == '\0')
112 return FALSE;
114 if (!g_unichar_isupper(g_utf8_get_char_validated(word, -1)))
115 return FALSE;
117 return is_word_lowercase(g_utf8_offset_to_pointer(word, 1));
120 static gchar *
121 make_word_proper(const gchar *word)
123 char buf[7];
124 gchar *lower = g_utf8_strdown(word, -1);
125 gint bytes;
126 gchar *ret;
128 bytes = g_unichar_to_utf8(g_unichar_toupper(g_utf8_get_char(word)), buf);
129 buf[MIN(bytes, sizeof(buf) - 1)] = '\0';
131 ret = g_strconcat(buf, g_utf8_offset_to_pointer(lower, 1), NULL);
132 g_free(lower);
134 return ret;
137 static gboolean
138 substitute_simple_buffer(GtkTextBuffer *buffer)
140 GtkTextIter start;
141 GtkTextIter end;
142 GtkTreeIter treeiter;
143 gchar *text = NULL;
145 gtk_text_buffer_get_iter_at_offset(buffer, &start, 0);
146 gtk_text_buffer_get_iter_at_offset(buffer, &end, 0);
147 gtk_text_iter_forward_to_end(&end);
149 text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
151 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &treeiter) && text) {
152 do {
153 GValue val1;
154 const gchar *bad;
155 gchar *cursor;
156 glong char_pos;
158 val1.g_type = 0;
159 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &treeiter, WORD_ONLY_COLUMN, &val1);
160 if (g_value_get_boolean(&val1))
162 g_value_unset(&val1);
163 continue;
165 g_value_unset(&val1);
167 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &treeiter, BAD_COLUMN, &val1);
168 bad = g_value_get_string(&val1);
170 /* using g_utf8_* to get /character/ offsets instead of byte offsets for buffer */
171 if ((cursor = g_strrstr(text, bad)))
173 GValue val2;
174 const gchar *good;
176 val2.g_type = 0;
177 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &treeiter, GOOD_COLUMN, &val2);
178 good = g_value_get_string(&val2);
180 char_pos = g_utf8_pointer_to_offset(text, cursor);
181 gtk_text_buffer_get_iter_at_offset(buffer, &start, char_pos);
182 gtk_text_buffer_get_iter_at_offset(buffer, &end, char_pos + g_utf8_strlen(bad, -1));
183 gtk_text_buffer_delete(buffer, &start, &end);
185 gtk_text_buffer_get_iter_at_offset(buffer, &start, char_pos);
186 gtk_text_buffer_insert(buffer, &start, good, -1);
188 g_value_unset(&val2);
189 g_free(text);
191 g_value_unset(&val1);
192 return TRUE;
195 g_value_unset(&val1);
196 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &treeiter));
199 g_free(text);
200 return FALSE;
203 static gchar *
204 substitute_word(gchar *word)
206 GtkTreeIter iter;
207 gchar *outword;
208 gchar *lowerword;
209 gchar *foldedword;
211 if (word == NULL)
212 return NULL;
214 lowerword = g_utf8_strdown(word, -1);
215 foldedword = g_utf8_casefold(word, -1);
217 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) {
218 do {
219 GValue val1;
220 gboolean case_sensitive;
221 const char *bad;
222 gchar *tmpbad = NULL;
224 val1.g_type = 0;
225 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, WORD_ONLY_COLUMN, &val1);
226 if (!g_value_get_boolean(&val1)) {
227 g_value_unset(&val1);
228 continue;
230 g_value_unset(&val1);
232 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, CASE_SENSITIVE_COLUMN, &val1);
233 case_sensitive = g_value_get_boolean(&val1);
234 g_value_unset(&val1);
236 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, BAD_COLUMN, &val1);
237 bad = g_value_get_string(&val1);
239 if ((case_sensitive && !strcmp(bad, word)) ||
240 (!case_sensitive && (!strcmp(bad, lowerword) ||
241 (!is_word_lowercase(bad) &&
242 !strcmp((tmpbad = g_utf8_casefold(bad, -1)), foldedword)))))
244 GValue val2;
245 const char *good;
247 g_free(tmpbad);
249 val2.g_type = 0;
250 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GOOD_COLUMN, &val2);
251 good = g_value_get_string(&val2);
253 if (!case_sensitive && is_word_lowercase(bad) && is_word_lowercase(good))
255 if (is_word_uppercase(word))
256 outword = g_utf8_strup(good, -1);
257 else if (is_word_proper(word))
258 outword = make_word_proper(good);
259 else
260 outword = g_strdup(good);
262 else
263 outword = g_strdup(good);
265 g_value_unset(&val1);
266 g_value_unset(&val2);
268 g_free(foldedword);
269 return outword;
272 g_value_unset(&val1);
273 g_free(tmpbad);
275 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
277 g_free(foldedword);
279 return NULL;
282 static void
283 spellchk_free(spellchk *spell)
285 GtkTextBuffer *buffer;
287 g_return_if_fail(spell != NULL);
289 buffer = gtk_text_view_get_buffer(spell->view);
291 g_signal_handlers_disconnect_matched(buffer,
292 G_SIGNAL_MATCH_DATA,
293 0, 0, NULL, NULL,
294 spell);
295 g_free(spell);
298 /* Pango doesn't know about the "'" character. Let's fix that. */
299 static gboolean
300 spellchk_inside_word(GtkTextIter *iter)
302 gunichar ucs4_char = gtk_text_iter_get_char(iter);
303 gchar *utf8_str;
304 gchar c = 0;
306 utf8_str = g_ucs4_to_utf8(&ucs4_char, 1, NULL, NULL, NULL);
307 if (utf8_str != NULL)
309 c = utf8_str[0];
310 g_free(utf8_str);
313 /* Hack because otherwise typing things like U.S. gets difficult
314 * if you have 'u' -> 'you' set as a correction...
316 * Part 1 of 2: This marks . as being an inside-word character. */
317 if (c == '.')
318 return TRUE;
320 /* Avoid problems with \r, for example (SF #1289031). */
321 if (c == '\\')
322 return TRUE;
324 if (gtk_text_iter_inside_word (iter) == TRUE)
325 return TRUE;
327 if (c == '\'') {
328 gboolean result = gtk_text_iter_backward_char(iter);
329 gboolean output = gtk_text_iter_inside_word(iter);
331 if (result)
334 * Hack so that "u'll" will correct correctly.
336 ucs4_char = gtk_text_iter_get_char(iter);
337 utf8_str = g_ucs4_to_utf8(&ucs4_char, 1, NULL, NULL, NULL);
338 if (utf8_str != NULL)
340 c = utf8_str[0];
341 g_free(utf8_str);
343 if (c == 'u' || c == 'U')
345 gtk_text_iter_forward_char(iter);
346 return FALSE;
350 gtk_text_iter_forward_char(iter);
353 return output;
355 else if (c == '&')
356 return TRUE;
358 return FALSE;
361 static gboolean
362 spellchk_backward_word_start(GtkTextIter *iter)
364 int output;
365 int result;
367 output = gtk_text_iter_backward_word_start(iter);
369 /* It didn't work... */
370 if (!output)
371 return FALSE;
373 while (spellchk_inside_word(iter)) {
374 result = gtk_text_iter_backward_char(iter);
376 /* We can't go backwards anymore? We're at the beginning of the word. */
377 if (!result)
378 return TRUE;
380 if (!spellchk_inside_word(iter)) {
381 gtk_text_iter_forward_char(iter);
382 return TRUE;
385 output = gtk_text_iter_backward_word_start(iter);
386 if (!output)
387 return FALSE;
390 return TRUE;
393 static gboolean
394 check_range(spellchk *spell, GtkTextBuffer *buffer,
395 GtkTextIter start, GtkTextIter end, gboolean sending)
397 gboolean replaced;
398 gboolean result;
399 gchar *tmp;
400 int period_count = 0;
401 gchar *word;
402 GtkTextMark *mark;
403 GtkTextIter pos;
405 if ((replaced = substitute_simple_buffer(buffer)))
407 mark = gtk_text_buffer_get_insert(buffer);
408 gtk_text_buffer_get_iter_at_mark(buffer, &pos, mark);
409 spell->pos = gtk_text_iter_get_offset(&pos);
411 gtk_text_buffer_get_iter_at_mark(buffer, &start, mark);
412 gtk_text_buffer_get_iter_at_mark(buffer, &end, mark);
415 if (!sending)
417 /* We need to go backwords to find out if we are inside a word or not. */
418 gtk_text_iter_backward_char(&end);
420 if (spellchk_inside_word(&end))
422 gtk_text_iter_forward_char(&end);
423 return replaced; /* We only pay attention to whole words. */
427 /* We could be in the middle of a whitespace block. Check for that. */
428 result = gtk_text_iter_backward_char(&end);
430 if (!spellchk_inside_word(&end))
432 if (result)
433 gtk_text_iter_forward_char(&end);
434 return replaced;
437 if (result)
438 gtk_text_iter_forward_char(&end);
440 /* Move backwards to the beginning of the word. */
441 spellchk_backward_word_start(&start);
443 spell->word = gtk_text_iter_get_text(&start, &end);
445 /* Hack because otherwise typing things like U.S. gets difficult
446 * if you have 'u' -> 'you' set as a correction...
448 * Part 2 of 2: This chops periods off the end of the word so
449 * the right substitution entry is found. */
450 tmp = g_strdup(spell->word);
451 if (tmp != NULL && *tmp != '\0') {
452 gchar *c;
453 for (c = tmp + strlen(tmp) - 1 ; c != tmp ; c--) {
454 if (*c == '.') {
455 *c = '\0';
456 period_count++;
457 } else
458 break;
462 if ((word = substitute_word(tmp))) {
463 GtkTextMark *mark;
464 GtkTextIter pos;
465 gchar *tmp2;
466 int i;
468 for (i = 1 ; i <= period_count ; i++) {
469 tmp2 = g_strconcat(word, ".", NULL);
470 g_free(word);
471 word = tmp2;
474 gtk_text_buffer_delete(buffer, &start, &end);
475 gtk_text_buffer_insert(buffer, &start, word, -1);
477 mark = gtk_text_buffer_get_insert(buffer);
478 gtk_text_buffer_get_iter_at_mark(buffer, &pos, mark);
479 spell->pos = gtk_text_iter_get_offset(&pos);
481 g_free(word);
482 g_free(tmp);
483 return TRUE;
485 g_free(tmp);
487 spell->word = NULL;
489 return replaced;
492 /* insertion works like this:
493 * - before the text is inserted, we mark the position in the buffer.
494 * - after the text is inserted, we see where our mark is and use that and
495 * the current position to check the entire range of inserted text.
497 * this may be overkill for the common case (inserting one character). */
498 static void
499 insert_text_before(GtkTextBuffer *buffer, GtkTextIter *iter,
500 gchar *text, gint len, spellchk *spell)
502 if (spell->inserting == TRUE)
503 return;
505 spell->inserting = TRUE;
507 spell->word = NULL;
509 gtk_text_buffer_move_mark(buffer, spell->mark_insert_start, iter);
512 static void
513 insert_text_after(GtkTextBuffer *buffer, GtkTextIter *iter,
514 gchar *text, gint len, spellchk *spell)
516 GtkTextIter start, end;
517 GtkTextMark *mark;
519 spell->ignore_correction_on_send = FALSE;
521 if (spell->ignore_correction) {
522 spell->ignore_correction = FALSE;
523 return;
526 /* we need to check a range of text. */
527 gtk_text_buffer_get_iter_at_mark(buffer, &start, spell->mark_insert_start);
529 if (len == 1)
530 check_range(spell, buffer, start, *iter, FALSE);
532 /* if check_range modified the buffer, iter has been invalidated */
533 mark = gtk_text_buffer_get_insert(buffer);
534 gtk_text_buffer_get_iter_at_mark(buffer, &end, mark);
535 gtk_text_buffer_move_mark(buffer, spell->mark_insert_end, &end);
537 spell->inserting = FALSE;
540 static void
541 delete_range_after(GtkTextBuffer *buffer,
542 GtkTextIter *start, GtkTextIter *end, spellchk *spell)
544 GtkTextIter start2, end2;
545 GtkTextMark *mark;
546 GtkTextIter pos;
547 gint place;
549 spell->ignore_correction_on_send = FALSE;
551 if (!spell->word)
552 return;
554 if (spell->inserting == TRUE)
555 return;
557 spell->inserting = TRUE;
559 mark = gtk_text_buffer_get_insert(buffer);
560 gtk_text_buffer_get_iter_at_mark(buffer, &pos, mark);
561 place = gtk_text_iter_get_offset(&pos);
563 if ((place + 1) != spell->pos) {
564 spell->word = NULL;
565 return;
568 gtk_text_buffer_get_iter_at_mark(buffer, &start2, spell->mark_insert_start);
569 gtk_text_buffer_get_iter_at_mark(buffer, &end2, spell->mark_insert_end);
571 gtk_text_buffer_delete(buffer, &start2, &end2);
572 gtk_text_buffer_insert(buffer, &start2, spell->word, -1);
573 spell->ignore_correction = TRUE;
574 spell->ignore_correction_on_send = TRUE;
576 spell->inserting = FALSE;
577 spell->word = NULL;
580 static void
581 message_send_cb(GtkWidget *widget, spellchk *spell)
583 GtkTextBuffer *buffer;
584 GtkTextIter start, end;
585 GtkTextMark *mark;
586 gboolean replaced;
588 if (spell->ignore_correction_on_send)
590 spell->ignore_correction_on_send = FALSE;
591 return;
594 #if 0
595 if (!purple_prefs_get_bool("/plugins/gtk/spellchk/last_word_replace"))
596 return;
597 #endif
599 buffer = gtk_text_view_get_buffer(spell->view);
601 gtk_text_buffer_get_end_iter(buffer, &start);
602 gtk_text_buffer_get_end_iter(buffer, &end);
603 spell->inserting = TRUE;
604 replaced = check_range(spell, buffer, start, end, TRUE);
605 spell->inserting = FALSE;
607 /* if check_range modified the buffer, iter has been invalidated */
608 mark = gtk_text_buffer_get_insert(buffer);
609 gtk_text_buffer_get_iter_at_mark(buffer, &end, mark);
610 gtk_text_buffer_move_mark(buffer, spell->mark_insert_end, &end);
612 if (replaced)
614 g_signal_stop_emission_by_name(widget, "message_send");
615 spell->ignore_correction_on_send = TRUE;
619 static void
620 spellchk_new_attach(PurpleConversation *conv)
622 spellchk *spell;
623 GtkTextBuffer *buffer;
624 GtkTextIter start, end;
625 PidginConversation *gtkconv;
626 GtkTextView *view;
628 gtkconv = PIDGIN_CONVERSATION(conv);
630 view = GTK_TEXT_VIEW(gtkconv->entry);
632 spell = g_object_get_data(G_OBJECT(view), SPELLCHK_OBJECT_KEY);
633 if (spell != NULL)
634 return;
636 /* attach to the widget */
637 spell = g_new0(spellchk, 1);
638 spell->view = view;
640 g_object_set_data_full(G_OBJECT(view), SPELLCHK_OBJECT_KEY, spell,
641 (GDestroyNotify)spellchk_free);
643 buffer = gtk_text_view_get_buffer(view);
645 /* we create the mark here, but we don't use it until text is
646 * inserted, so we don't really care where iter points. */
647 gtk_text_buffer_get_bounds(buffer, &start, &end);
648 spell->mark_insert_start = gtk_text_buffer_create_mark(buffer,
649 "spellchk-insert-start",
650 &start, TRUE);
651 spell->mark_insert_end = gtk_text_buffer_create_mark(buffer,
652 "spellchk-insert-end",
653 &start, TRUE);
655 g_signal_connect_after(G_OBJECT(buffer),
656 "delete-range",
657 G_CALLBACK(delete_range_after), spell);
658 g_signal_connect(G_OBJECT(buffer),
659 "insert-text",
660 G_CALLBACK(insert_text_before), spell);
661 g_signal_connect_after(G_OBJECT(buffer),
662 "insert-text",
663 G_CALLBACK(insert_text_after), spell);
665 g_signal_connect(G_OBJECT(gtkconv->entry), "message_send",
666 G_CALLBACK(message_send_cb), spell);
667 return;
670 static int buf_get_line(char *ibuf, char **buf, int *position, gsize len)
672 int pos = *position;
673 int spos = pos;
675 if (pos == len)
676 return 0;
678 while (!(ibuf[pos] == '\n' ||
679 (ibuf[pos] == '\r' && ibuf[pos + 1] != '\n')))
681 pos++;
682 if (pos == len)
683 return 0;
686 if (pos != 0 && ibuf[pos] == '\n' && ibuf[pos - 1] == '\r')
687 ibuf[pos - 1] = '\0';
689 ibuf[pos] = '\0';
690 *buf = &ibuf[spos];
692 pos++;
693 *position = pos;
695 return 1;
698 static void load_conf()
700 /* Corrections to change "...", "(c)", "(r)", and "(tm)" to their
701 * Unicode character equivalents were not added here even though
702 * they existed in the source list(s). I think these corrections
703 * would be more trouble than they're worth.
705 const char * const defaultconf =
706 "BAD abbout\nGOOD about\n"
707 "BAD abotu\nGOOD about\n"
708 "BAD abouta\nGOOD about a\n"
709 "BAD aboutit\nGOOD about it\n"
710 "BAD aboutthe\nGOOD about the\n"
711 "BAD abscence\nGOOD absence\n"
712 "BAD accesories\nGOOD accessories\n"
713 "BAD accidant\nGOOD accident\n"
714 "BAD accomodate\nGOOD accommodate\n"
715 "BAD accordingto\nGOOD according to\n"
716 "BAD accross\nGOOD across\n"
717 "BAD acheive\nGOOD achieve\n"
718 "BAD acheived\nGOOD achieved\n"
719 "BAD acheiving\nGOOD achieving\n"
720 "BAD acn\nGOOD can\n"
721 "BAD acommodate\nGOOD accommodate\n"
722 "BAD acomodate\nGOOD accommodate\n"
723 "BAD actualyl\nGOOD actually\n"
724 "BAD additinal\nGOOD additional\n"
725 "BAD addtional\nGOOD additional\n"
726 "BAD adequit\nGOOD adequate\n"
727 "BAD adequite\nGOOD adequate\n"
728 "BAD adn\nGOOD and\n"
729 "BAD advanage\nGOOD advantage\n"
730 "BAD affraid\nGOOD afraid\n"
731 "BAD afterthe\nGOOD after the\n"
732 "COMPLETE 0\nBAD againstt he \nGOOD against the \n"
733 "BAD aganist\nGOOD against\n"
734 "BAD aggresive\nGOOD aggressive\n"
735 "BAD agian\nGOOD again\n"
736 "BAD agreemeent\nGOOD agreement\n"
737 "BAD agreemeents\nGOOD agreements\n"
738 "BAD agreemnet\nGOOD agreement\n"
739 "BAD agreemnets\nGOOD agreements\n"
740 "BAD agressive\nGOOD aggressive\n"
741 "BAD agressiveness\nGOOD aggressiveness\n"
742 "BAD ahd\nGOOD had\n"
743 "BAD ahold\nGOOD a hold\n"
744 "BAD ahppen\nGOOD happen\n"
745 "BAD ahve\nGOOD have\n"
746 "BAD allready\nGOOD already\n"
747 "BAD allwasy\nGOOD always\n"
748 "BAD allwyas\nGOOD always\n"
749 "BAD almots\nGOOD almost\n"
750 "BAD almsot\nGOOD almost\n"
751 "BAD alomst\nGOOD almost\n"
752 "BAD alot\nGOOD a lot\n"
753 "BAD alraedy\nGOOD already\n"
754 "BAD alreayd\nGOOD already\n"
755 "BAD alreday\nGOOD already\n"
756 "BAD alwasy\nGOOD always\n"
757 "BAD alwats\nGOOD always\n"
758 "BAD alway\nGOOD always\n"
759 "BAD alwyas\nGOOD always\n"
760 "BAD amde\nGOOD made\n"
761 "BAD Ameria\nGOOD America\n"
762 "BAD amke\nGOOD make\n"
763 "BAD amkes\nGOOD makes\n"
764 "BAD anbd\nGOOD and\n"
765 "BAD andone\nGOOD and one\n"
766 "BAD andteh\nGOOD and the\n"
767 "BAD andthe\nGOOD and the\n"
768 "COMPLETE 0\nBAD andt he \nGOOD and the \n"
769 "BAD anothe\nGOOD another\n"
770 "BAD anual\nGOOD annual\n"
771 "BAD any1\nGOOD anyone\n"
772 "BAD apparant\nGOOD apparent\n"
773 "BAD apparrent\nGOOD apparent\n"
774 "BAD appearence\nGOOD appearance\n"
775 "BAD appeares\nGOOD appears\n"
776 "BAD applicaiton\nGOOD application\n"
777 "BAD applicaitons\nGOOD applications\n"
778 "BAD applyed\nGOOD applied\n"
779 "BAD appointiment\nGOOD appointment\n"
780 "BAD approrpiate\nGOOD appropriate\n"
781 "BAD approrpriate\nGOOD appropriate\n"
782 "BAD aquisition\nGOOD acquisition\n"
783 "BAD aquisitions\nGOOD acquisitions\n"
784 "BAD arent\nGOOD aren't\n"
785 "COMPLETE 0\nBAD aren;t \nGOOD aren't \n"
786 "BAD arguement\nGOOD argument\n"
787 "BAD arguements\nGOOD arguments\n"
788 "COMPLETE 0\nBAD arn't \nGOOD aren't \n"
789 "BAD arond\nGOOD around\n"
790 "BAD artical\nGOOD article\n"
791 "BAD articel\nGOOD article\n"
792 "BAD asdvertising\nGOOD advertising\n"
793 "COMPLETE 0\nBAD askt he \nGOOD ask the \n"
794 "BAD assistent\nGOOD assistant\n"
795 "BAD asthe\nGOOD as the\n"
796 "BAD atention\nGOOD attention\n"
797 "BAD atmospher\nGOOD atmosphere\n"
798 "BAD attentioin\nGOOD attention\n"
799 "BAD atthe\nGOOD at the\n"
800 "BAD audeince\nGOOD audience\n"
801 "BAD audiance\nGOOD audience\n"
802 "BAD authentification\nGOOD authentication\n"
803 "BAD availalbe\nGOOD available\n"
804 "BAD awya\nGOOD away\n"
805 "BAD aywa\nGOOD away\n"
806 "BAD b4\nGOOD before\n"
807 "BAD bakc\nGOOD back\n"
808 "BAD balence\nGOOD balance\n"
809 "BAD ballance\nGOOD balance\n"
810 "BAD baout\nGOOD about\n"
811 "BAD bcak\nGOOD back\n"
812 "BAD bcuz\nGOOD because\n"
813 "BAD beacuse\nGOOD because\n"
814 "BAD becasue\nGOOD because\n"
815 "BAD becaus\nGOOD because\n"
816 "BAD becausea\nGOOD because a\n"
817 "BAD becauseof\nGOOD because of\n"
818 "BAD becausethe\nGOOD because the\n"
819 "BAD becauseyou\nGOOD because you\n"
820 "COMPLETE 0\nBAD beckon call\nGOOD beck and call\n"
821 "BAD becomeing\nGOOD becoming\n"
822 "BAD becomming\nGOOD becoming\n"
823 "BAD becuase\nGOOD because\n"
824 "BAD becuse\nGOOD because\n"
825 "BAD befoer\nGOOD before\n"
826 "BAD beggining\nGOOD beginning\n"
827 "BAD begining\nGOOD beginning\n"
828 "BAD beginining\nGOOD beginning\n"
829 "BAD beleiev\nGOOD believe\n"
830 "BAD beleieve\nGOOD believe\n"
831 "BAD beleif\nGOOD belief\n"
832 "BAD beleive\nGOOD believe\n"
833 "BAD beleived\nGOOD believed\n"
834 "BAD beleives\nGOOD believes\n"
835 "BAD belive\nGOOD believe\n"
836 "BAD belived\nGOOD believed\n"
837 "BAD belives\nGOOD believes\n"
838 "BAD benifit\nGOOD benefit\n"
839 "BAD benifits\nGOOD benefits\n"
840 "BAD betwen\nGOOD between\n"
841 "BAD beutiful\nGOOD beautiful\n"
842 "BAD blase\nGOOD blas\303\251\n"
843 "BAD boxs\nGOOD boxes\n"
844 "BAD brodcast\nGOOD broadcast\n"
845 "BAD butthe\nGOOD but the\n"
846 "BAD bve\nGOOD be\n"
847 "COMPLETE 0\nBAD byt he \nGOOD by the \n"
848 "BAD cafe\nGOOD caf\303\251\n"
849 "BAD caharcter\nGOOD character\n"
850 "BAD calcullated\nGOOD calculated\n"
851 "BAD calulated\nGOOD calculated\n"
852 "BAD candidtae\nGOOD candidate\n"
853 "BAD candidtaes\nGOOD candidates\n"
854 "COMPLETE 0\nBAD case and point\nGOOD case in point\n"
855 "BAD cant\nGOOD can't\n"
856 "COMPLETE 0\nBAD can;t \nGOOD can't \n"
857 "COMPLETE 0\nBAD can't of been\nGOOD can't have been\n"
858 "BAD catagory\nGOOD category\n"
859 "BAD categiory\nGOOD category\n"
860 "BAD certian\nGOOD certain\n"
861 "BAD challange\nGOOD challenge\n"
862 "BAD challanges\nGOOD challenges\n"
863 "BAD chaneg\nGOOD change\n"
864 "BAD chanegs\nGOOD changes\n"
865 "BAD changable\nGOOD changeable\n"
866 "BAD changeing\nGOOD changing\n"
867 "BAD changng\nGOOD changing\n"
868 "BAD charachter\nGOOD character\n"
869 "BAD charachters\nGOOD characters\n"
870 "BAD charactor\nGOOD character\n"
871 "BAD charecter\nGOOD character\n"
872 "BAD charector\nGOOD character\n"
873 "BAD cheif\nGOOD chief\n"
874 "BAD chekc\nGOOD check\n"
875 "BAD chnage\nGOOD change\n"
876 "BAD cieling\nGOOD ceiling\n"
877 "BAD circut\nGOOD circuit\n"
878 "BAD claer\nGOOD clear\n"
879 "BAD claered\nGOOD cleared\n"
880 "BAD claerly\nGOOD clearly\n"
881 "BAD cliant\nGOOD client\n"
882 "BAD cliche\nGOOD clich\303\251\n"
883 "BAD cna\nGOOD can\n"
884 "BAD colection\nGOOD collection\n"
885 "BAD comanies\nGOOD companies\n"
886 "BAD comany\nGOOD company\n"
887 "BAD comapnies\nGOOD companies\n"
888 "BAD comapny\nGOOD company\n"
889 "BAD combintation\nGOOD combination\n"
890 "BAD comited\nGOOD committed\n"
891 "BAD comittee\nGOOD committee\n"
892 "BAD commadn\nGOOD command\n"
893 "BAD comming\nGOOD coming\n"
894 "BAD commitee\nGOOD committee\n"
895 "BAD committe\nGOOD committee\n"
896 "BAD committment\nGOOD commitment\n"
897 "BAD committments\nGOOD commitments\n"
898 "BAD committy\nGOOD committee\n"
899 "BAD comntain\nGOOD contain\n"
900 "BAD comntains\nGOOD contains\n"
901 "BAD compair\nGOOD compare\n"
902 "COMPLETE 0\nBAD company;s \nGOOD company's \n"
903 "BAD competetive\nGOOD competitive\n"
904 "BAD compleated\nGOOD completed\n"
905 "BAD compleatly\nGOOD completely\n"
906 "BAD compleatness\nGOOD completeness\n"
907 "BAD completly\nGOOD completely\n"
908 "BAD completness\nGOOD completeness\n"
909 "BAD composate\nGOOD composite\n"
910 "BAD comtain\nGOOD contain\n"
911 "BAD comtains\nGOOD contains\n"
912 "BAD comunicate\nGOOD communicate\n"
913 "BAD comunity\nGOOD community\n"
914 "BAD condolances\nGOOD condolences\n"
915 "BAD conected\nGOOD connected\n"
916 "BAD conferance\nGOOD conference\n"
917 "BAD confirmmation\nGOOD confirmation\n"
918 "BAD congradulations\nGOOD congratulations\n"
919 "BAD considerit\nGOOD considerate\n"
920 "BAD considerite\nGOOD considerate\n"
921 "BAD consonent\nGOOD consonant\n"
922 "BAD conspiricy\nGOOD conspiracy\n"
923 "BAD consultent\nGOOD consultant\n"
924 "BAD convertable\nGOOD convertible\n"
925 "BAD cooparate\nGOOD cooperate\n"
926 "BAD cooporate\nGOOD cooperate\n"
927 "BAD corproation\nGOOD corporation\n"
928 "BAD corproations\nGOOD corporations\n"
929 "BAD corruptable\nGOOD corruptible\n"
930 "BAD cotten\nGOOD cotton\n"
931 "BAD coudl\nGOOD could\n"
932 "COMPLETE 0\nBAD coudln't \nGOOD couldn't \n"
933 "COMPLETE 0\nBAD coudn't \nGOOD couldn't \n"
934 "BAD couldnt\nGOOD couldn't\n"
935 "COMPLETE 0\nBAD couldn;t \nGOOD couldn't \n"
936 "COMPLETE 0\nBAD could of been\nGOOD could have been\n"
937 "COMPLETE 0\nBAD could of had\nGOOD could have had\n"
938 "BAD couldthe\nGOOD could the\n"
939 "BAD couldve\nGOOD could've\n"
940 "BAD cpoy\nGOOD copy\n"
941 "BAD creme\nGOOD cr\303\250me\n"
942 "BAD ctaegory\nGOOD category\n"
943 "BAD cu\nGOOD see you\n"
944 "BAD cusotmer\nGOOD customer\n"
945 "BAD cusotmers\nGOOD customers\n"
946 "BAD cutsomer\nGOOD customer\n"
947 "BAD cutsomers\nGOOD customer\n"
948 "BAD cuz\nGOOD because\n"
949 "BAD cxan\nGOOD can\n"
950 "BAD danceing\nGOOD dancing\n"
951 "BAD dcument\nGOOD document\n"
952 "BAD deatils\nGOOD details\n"
953 "BAD decison\nGOOD decision\n"
954 "BAD decisons\nGOOD decisions\n"
955 "BAD decor\nGOOD d\303\251cor\n"
956 "BAD defendent\nGOOD defendant\n"
957 "BAD definately\nGOOD definitely\n"
958 "COMPLETE 0\nBAD deja vu\nGOOD d\303\251j\303\240 vu\n"
959 "BAD deptartment\nGOOD department\n"
960 "BAD desicion\nGOOD decision\n"
961 "BAD desicions\nGOOD decisions\n"
962 "BAD desision\nGOOD decision\n"
963 "BAD desisions\nGOOD decisions\n"
964 "BAD detente\nGOOD d\303\251tente\n"
965 "BAD develeoprs\nGOOD developers\n"
966 "BAD devellop\nGOOD develop\n"
967 "BAD develloped\nGOOD developed\n"
968 "BAD develloper\nGOOD developer\n"
969 "BAD devellopers\nGOOD developers\n"
970 "BAD develloping\nGOOD developing\n"
971 "BAD devellopment\nGOOD development\n"
972 "BAD devellopments\nGOOD developments\n"
973 "BAD devellops\nGOOD develop\n"
974 "BAD develope\nGOOD develop\n"
975 "BAD developement\nGOOD development\n"
976 "BAD developements\nGOOD developments\n"
977 "BAD developor\nGOOD developer\n"
978 "BAD developors\nGOOD developers\n"
979 "BAD develpment\nGOOD development\n"
980 "BAD diaplay\nGOOD display\n"
981 "BAD didint\nGOOD didn't\n"
982 "BAD didnot\nGOOD did not\n"
983 "BAD didnt\nGOOD didn't\n"
984 "COMPLETE 0\nBAD didn;t \nGOOD didn't \n"
985 "BAD difefrent\nGOOD different\n"
986 "BAD diferences\nGOOD differences\n"
987 "BAD differance\nGOOD difference\n"
988 "BAD differances\nGOOD differences\n"
989 "BAD differant\nGOOD different\n"
990 "BAD differemt\nGOOD different\n"
991 "BAD differnt\nGOOD different\n"
992 "BAD diffrent\nGOOD different\n"
993 "BAD directer\nGOOD director\n"
994 "BAD directers\nGOOD directors\n"
995 "BAD directiosn\nGOOD direction\n"
996 "BAD disatisfied\nGOOD dissatisfied\n"
997 "BAD discoverd\nGOOD discovered\n"
998 "BAD disign\nGOOD design\n"
999 "BAD dispaly\nGOOD display\n"
1000 "BAD dissonent\nGOOD dissonant\n"
1001 "BAD distribusion\nGOOD distribution\n"
1002 "BAD divsion\nGOOD division\n"
1003 "BAD docuement\nGOOD documents\n"
1004 "BAD docuemnt\nGOOD document\n"
1005 "BAD documetn\nGOOD document\n"
1006 "BAD documnet\nGOOD document\n"
1007 "BAD documnets\nGOOD documents\n"
1008 "COMPLETE 0\nBAD doens't \nGOOD doesn't \n"
1009 "BAD doese\nGOOD does\n"
1010 "COMPLETE 0\nBAD doe snot \nGOOD does not \n"
1011 "BAD doesnt\nGOOD doesn't\n"
1012 "COMPLETE 0\nBAD doesn;t \nGOOD doesn't \n"
1013 "BAD doign\nGOOD doing\n"
1014 "BAD doimg\nGOOD doing\n"
1015 "BAD doind\nGOOD doing\n"
1016 "BAD dollers\nGOOD dollars\n"
1017 "BAD donig\nGOOD doing\n"
1018 "BAD donno\nGOOD don't know\n"
1019 "BAD dont\nGOOD don't\n"
1020 "COMPLETE 0\nBAD do'nt \nGOOD don't \n"
1021 "COMPLETE 0\nBAD don;t \nGOOD don't \n"
1022 "COMPLETE 0\nBAD don't no \nGOOD don't know \n"
1023 "COMPLETE 0\nBAD dosn't \nGOOD doesn't \n"
1024 "BAD driveing\nGOOD driving\n"
1025 "BAD drnik\nGOOD drink\n"
1026 "BAD dunno\nGOOD don't know\n"
1027 "BAD eclair\nGOOD \303\251clair\n"
1028 "BAD efel\nGOOD feel\n"
1029 "BAD effecient\nGOOD efficient\n"
1030 "BAD efort\nGOOD effort\n"
1031 "BAD eforts\nGOOD efforts\n"
1032 "BAD ehr\nGOOD her\n"
1033 "BAD eligable\nGOOD eligible\n"
1034 "BAD embarass\nGOOD embarrass\n"
1035 "BAD emigre\nGOOD \303\251migr\303\251\n"
1036 "BAD enought\nGOOD enough\n"
1037 "BAD entree\nGOOD entr\303\251e\n"
1038 "BAD enuf\nGOOD enough\n"
1039 "BAD equippment\nGOOD equipment\n"
1040 "BAD equivalant\nGOOD equivalent\n"
1041 "BAD esle\nGOOD else\n"
1042 "BAD especally\nGOOD especially\n"
1043 "BAD especialyl\nGOOD especially\n"
1044 "BAD espesially\nGOOD especially\n"
1045 "BAD essense\nGOOD essence\n"
1046 "BAD excellance\nGOOD excellence\n"
1047 "BAD excellant\nGOOD excellent\n"
1048 "BAD excercise\nGOOD exercise\n"
1049 "BAD exchagne\nGOOD exchange\n"
1050 "BAD exchagnes\nGOOD exchanges\n"
1051 "BAD excitment\nGOOD excitement\n"
1052 "BAD exhcange\nGOOD exchange\n"
1053 "BAD exhcanges\nGOOD exchanges\n"
1054 "BAD experiance\nGOOD experience\n"
1055 "BAD experienc\nGOOD experience\n"
1056 "BAD exprience\nGOOD experience\n"
1057 "BAD exprienced\nGOOD experienced\n"
1058 "BAD eyt\nGOOD yet\n"
1059 "BAD facade\nGOOD fa\303\247ade\n"
1060 "BAD faeture\nGOOD feature\n"
1061 "BAD faetures\nGOOD feature\n"
1062 "BAD familair\nGOOD familiar\n"
1063 "BAD familar\nGOOD familiar\n"
1064 "BAD familliar\nGOOD familiar\n"
1065 "BAD fammiliar\nGOOD familiar\n"
1066 "BAD feild\nGOOD field\n"
1067 "BAD feilds\nGOOD fields\n"
1068 "BAD fianlly\nGOOD finally\n"
1069 "BAD fidn\nGOOD find\n"
1070 "BAD finalyl\nGOOD finally\n"
1071 "BAD firends\nGOOD friends\n"
1072 "BAD firts\nGOOD first\n"
1073 "BAD follwo\nGOOD follow\n"
1074 "BAD follwoing\nGOOD following\n"
1075 "BAD fora\nGOOD for a\n"
1076 "COMPLETE 0\nBAD for all intensive purposes\nfor all intents and purposes\n"
1077 "BAD foriegn\nGOOD foreign\n"
1078 "BAD forthe\nGOOD for the\n"
1079 "BAD forwrd\nGOOD forward\n"
1080 "BAD forwrds\nGOOD forwards\n"
1081 "BAD foudn\nGOOD found\n"
1082 "BAD foward\nGOOD forward\n"
1083 "BAD fowards\nGOOD forwards\n"
1084 "BAD freind\nGOOD friend\n"
1085 "BAD freindly\nGOOD friendly\n"
1086 "BAD freinds\nGOOD friends\n"
1087 "BAD friday\nGOOD Friday\n"
1088 "BAD frmo\nGOOD from\n"
1089 "BAD fromthe\nGOOD from the\n"
1090 "COMPLETE 0\nBAD fromt he \nGOOD from the \n"
1091 "BAD furneral\nGOOD funeral\n"
1092 "BAD fwe\nGOOD few\n"
1093 "BAD garantee\nGOOD guarantee\n"
1094 "BAD gaurd\nGOOD guard\n"
1095 "BAD gemeral\nGOOD general\n"
1096 "BAD gerat\nGOOD great\n"
1097 "BAD geting\nGOOD getting\n"
1098 "BAD gettin\nGOOD getting\n"
1099 "BAD gievn\nGOOD given\n"
1100 "BAD giveing\nGOOD giving\n"
1101 "BAD gloabl\nGOOD global\n"
1102 "BAD goign\nGOOD going\n"
1103 "BAD gonig\nGOOD going\n"
1104 "BAD govenment\nGOOD government\n"
1105 "BAD goverment\nGOOD government\n"
1106 "BAD gruop\nGOOD group\n"
1107 "BAD gruops\nGOOD groups\n"
1108 "BAD grwo\nGOOD grow\n"
1109 "BAD guidlines\nGOOD guidelines\n"
1110 "BAD hadbeen\nGOOD had been\n"
1111 "BAD hadnt\nGOOD hadn't\n"
1112 "COMPLETE 0\nBAD hadn;t \nGOOD hadn't \n"
1113 "BAD haev\nGOOD have\n"
1114 "BAD hapen\nGOOD happen\n"
1115 "BAD hapened\nGOOD happened\n"
1116 "BAD hapening\nGOOD happening\n"
1117 "BAD hapens\nGOOD happens\n"
1118 "BAD happend\nGOOD happened\n"
1119 "BAD hasbeen\nGOOD has been\n"
1120 "BAD hasnt\nGOOD hasn't\n"
1121 "COMPLETE 0\nBAD hasn;t \nGOOD hasn't \n"
1122 "BAD havebeen\nGOOD have been\n"
1123 "BAD haveing\nGOOD having\n"
1124 "BAD havent\nGOOD haven't\n"
1125 "COMPLETE 0\nBAD haven;t \nGOOD haven't \n"
1126 "BAD hda\nGOOD had\n"
1127 "BAD hearign\nGOOD hearing\n"
1128 "COMPLETE 0\nBAD he;d \nGOOD he'd \n"
1129 "BAD heirarchy\nGOOD hierarchy\n"
1130 "BAD hel\nGOOD he'll\n"
1131 "COMPLETE 0\nBAD he;ll \nGOOD he'll \n"
1132 "BAD helpfull\nGOOD helpful\n"
1133 "BAD herat\nGOOD heart\n"
1134 "BAD heres\nGOOD here's\n"
1135 "COMPLETE 0\nBAD here;s \nGOOD here's \n"
1136 "BAD hes\nGOOD he's\n"
1137 "COMPLETE 0\nBAD he;s \nGOOD he's \n"
1138 "BAD hesaid\nGOOD he said\n"
1139 "BAD hewas\nGOOD he was\n"
1140 "BAD hge\nGOOD he\n"
1141 "BAD hismelf\nGOOD himself\n"
1142 "BAD hlep\nGOOD help\n"
1143 "BAD hott\nGOOD hot\n"
1144 "BAD hows\nGOOD how's\n"
1145 "BAD hsa\nGOOD has\n"
1146 "BAD hse\nGOOD she\n"
1147 "BAD hsi\nGOOD his\n"
1148 "BAD hte\nGOOD the\n"
1149 "BAD htere\nGOOD there\n"
1150 "BAD htese\nGOOD these\n"
1151 "BAD htey\nGOOD they\n"
1152 "BAD hting\nGOOD thing\n"
1153 "BAD htink\nGOOD think\n"
1154 "BAD htis\nGOOD this\n"
1155 "COMPLETE 0\nBAD htp:\nGOOD http:\n"
1156 "COMPLETE 0\nBAD http:\\\\nGOOD http://\n"
1157 "BAD httpL\nGOOD http:\n"
1158 "BAD hvae\nGOOD have\n"
1159 "BAD hvaing\nGOOD having\n"
1160 "BAD hwich\nGOOD which\n"
1161 "BAD i\nGOOD I\n"
1162 "COMPLETE 0\nBAD i c \nGOOD I see \n"
1163 "COMPLETE 0\nBAD i;d \nGOOD I'd \n"
1164 "COMPLETE 0\nBAD i'd \nGOOD I'd \n"
1165 "COMPLETE 0\nBAD I;d \nGOOD I'd \n"
1166 "BAD idae\nGOOD idea\n"
1167 "BAD idaes\nGOOD ideas\n"
1168 "BAD identofy\nGOOD identify\n"
1169 "BAD ihs\nGOOD his\n"
1170 "BAD iits the\nGOOD it's the\n"
1171 "COMPLETE 0\nBAD i'll \nGOOD I'll \n"
1172 "COMPLETE 0\nBAD I;ll \nGOOD I'll \n"
1173 "COMPLETE 0\nBAD i;m \nGOOD I'm \n"
1174 "COMPLETE 0\nBAD i'm \nGOOD I'm \n"
1175 "COMPLETE 0\nBAD I\"m \nGOOD I'm \n"
1176 "BAD imediate\nGOOD immediate\n"
1177 "BAD imediatly\nGOOD immediately\n"
1178 "BAD immediatly\nGOOD immediately\n"
1179 "BAD importent\nGOOD important\n"
1180 "BAD importnat\nGOOD important\n"
1181 "BAD impossable\nGOOD impossible\n"
1182 "BAD improvemnt\nGOOD improvement\n"
1183 "BAD improvment\nGOOD improvement\n"
1184 "BAD includ\nGOOD include\n"
1185 "BAD indecate\nGOOD indicate\n"
1186 "BAD indenpendence\nGOOD independence\n"
1187 "BAD indenpendent\nGOOD independent\n"
1188 "BAD indepedent\nGOOD independent\n"
1189 "BAD independance\nGOOD independence\n"
1190 "BAD independant\nGOOD independent\n"
1191 "BAD influance\nGOOD influence\n"
1192 "BAD infomation\nGOOD information\n"
1193 "BAD informatoin\nGOOD information\n"
1194 "BAD inital\nGOOD initial\n"
1195 "BAD instaleld\nGOOD installed\n"
1196 "BAD insted\nGOOD instead\n"
1197 "BAD insurence\nGOOD insurance\n"
1198 "BAD inteh\nGOOD in the\n"
1199 "BAD interum\nGOOD interim\n"
1200 "BAD inthe\nGOOD in the\n"
1201 "COMPLETE 0\nBAD int he \nGOOD in the \n"
1202 "BAD inturn\nGOOD intern\n"
1203 "BAD inwhich\nGOOD in which\n"
1204 "COMPLETE 0\nBAD i snot \nGOOD is not \n"
1205 "BAD isnt\nGOOD isn't\n"
1206 "COMPLETE 0\nBAD isn;t \nGOOD isn't \n"
1207 "BAD isthe\nGOOD is the\n"
1208 "BAD itd\nGOOD it'd\n"
1209 "COMPLETE 0\nBAD it;d \nGOOD it'd \n"
1210 "BAD itis\nGOOD it is\n"
1211 "BAD ititial\nGOOD initial\n"
1212 "BAD itll\nGOOD it'll\n"
1213 "COMPLETE 0\nBAD it;ll \nGOOD it'll \n"
1214 "BAD itnerest\nGOOD interest\n"
1215 "BAD itnerested\nGOOD interested\n"
1216 "BAD itneresting\nGOOD interesting\n"
1217 "BAD itnerests\nGOOD interests\n"
1218 "COMPLETE 0\nBAD it;s \nGOOD it's \n"
1219 "BAD itsa\nGOOD it's a\n"
1220 "COMPLETE 0\nBAD its a \nGOOD it's a \n"
1221 "COMPLETE 0\nBAD it snot \nGOOD it's not \n"
1222 "COMPLETE 0\nBAD it' snot \nGOOD it's not \n"
1223 "COMPLETE 0\nBAD its the \nGOOD it's the \n"
1224 "BAD itwas\nGOOD it was\n"
1225 "BAD ive\nGOOD I've\n"
1226 "COMPLETE 0\nBAD i;ve \nGOOD I've \n"
1227 "COMPLETE 0\nBAD i've \nGOOD I've \n"
1228 "BAD iwll\nGOOD will\n"
1229 "BAD iwth\nGOOD with\n"
1230 "BAD jsut\nGOOD just\n"
1231 "BAD jugment\nGOOD judgment\n"
1232 "BAD kno\nGOOD know\n"
1233 "BAD knowldge\nGOOD knowledge\n"
1234 "BAD knowlege\nGOOD knowledge\n"
1235 "BAD knwo\nGOOD know\n"
1236 "BAD knwon\nGOOD known\n"
1237 "BAD knwos\nGOOD knows\n"
1238 "BAD konw\nGOOD know\n"
1239 "BAD konwn\nGOOD known\n"
1240 "BAD konws\nGOOD knows\n"
1241 "BAD labratory\nGOOD laboratory\n"
1242 "BAD labtop\nGOOD laptop\n"
1243 "BAD lastyear\nGOOD last year\n"
1244 "BAD laterz\nGOOD later\n"
1245 "BAD learnign\nGOOD learning\n"
1246 "BAD lenght\nGOOD length\n"
1247 "COMPLETE 0\nBAD let;s \nGOOD let's \n"
1248 "COMPLETE 0\nBAD let's him \nGOOD lets him \n"
1249 "COMPLETE 0\nBAD let's it \nGOOD lets it \n"
1250 "BAD levle\nGOOD level\n"
1251 "BAD libary\nGOOD library\n"
1252 "BAD librarry\nGOOD library\n"
1253 "BAD librery\nGOOD library\n"
1254 "BAD liek\nGOOD like\n"
1255 "BAD liekd\nGOOD liked\n"
1256 "BAD lieutenent\nGOOD lieutenant\n"
1257 "BAD liev\nGOOD live\n"
1258 "BAD likly\nGOOD likely\n"
1259 "BAD lisense\nGOOD license\n"
1260 "BAD littel\nGOOD little\n"
1261 "BAD litttle\nGOOD little\n"
1262 "BAD liuke\nGOOD like\n"
1263 "BAD liveing\nGOOD living\n"
1264 "BAD loev\nGOOD love\n"
1265 "BAD lonly\nGOOD lonely\n"
1266 "BAD lookign\nGOOD looking\n"
1267 "BAD m\nGOOD am\n"
1268 "BAD maintainence\nGOOD maintenance\n"
1269 "BAD maintenence\nGOOD maintenance\n"
1270 "BAD makeing\nGOOD making\n"
1271 "BAD managment\nGOOD management\n"
1272 "BAD mantain\nGOOD maintain\n"
1273 "BAD marraige\nGOOD marriage\n"
1274 "COMPLETE 0\nBAD may of been\nGOOD may have been\n"
1275 "COMPLETE 0\nBAD may of had\nGOOD may have had\n"
1276 "BAD memeber\nGOOD member\n"
1277 "BAD merchent\nGOOD merchant\n"
1278 "BAD mesage\nGOOD message\n"
1279 "BAD mesages\nGOOD messages\n"
1280 "COMPLETE 0\nBAD might of been\nGOOD might have been\n"
1281 "COMPLETE 0\nBAD might of had\nGOOD might have had\n"
1282 "BAD mispell\nGOOD misspell\n"
1283 "BAD mispelling\nGOOD misspelling\n"
1284 "BAD mispellings\nGOOD misspellings\n"
1285 "BAD mkae\nGOOD make\n"
1286 "BAD mkaes\nGOOD makes\n"
1287 "BAD mkaing\nGOOD making\n"
1288 "BAD moeny\nGOOD money\n"
1289 "BAD monday\nGOOD Monday\n"
1290 "BAD morgage\nGOOD mortgage\n"
1291 "BAD mroe\nGOOD more\n"
1292 "COMPLETE 0\nBAD must of been\nGOOD must have been\n"
1293 "COMPLETE 0\nBAD must of had\nGOOD must have had\n"
1294 "COMPLETE 0\nBAD mute point\nGOOD moot point\n"
1295 "BAD mysefl\nGOOD myself\n"
1296 "BAD myu\nGOOD my\n"
1297 "BAD naive\nGOOD naïve\n"
1298 "BAD ne1\nGOOD anyone\n"
1299 "BAD neway\nGOOD anyway\n"
1300 "BAD neways\nGOOD anyways\n"
1301 "BAD necassarily\nGOOD necessarily\n"
1302 "BAD necassary\nGOOD necessary\n"
1303 "BAD neccessarily\nGOOD necessarily\n"
1304 "BAD neccessary\nGOOD necessary\n"
1305 "BAD necesarily\nGOOD necessarily\n"
1306 "BAD necesary\nGOOD necessary\n"
1307 "BAD negotiaing\nGOOD negotiating\n"
1308 "BAD nkow\nGOOD know\n"
1309 "BAD nothign\nGOOD nothing\n"
1310 "BAD nto\nGOOD not\n"
1311 "BAD nver\nGOOD never\n"
1312 "BAD nwe\nGOOD new\n"
1313 "BAD nwo\nGOOD now\n"
1314 "BAD obediant\nGOOD obedient\n"
1315 "BAD ocasion\nGOOD occasion\n"
1316 "BAD occassion\nGOOD occasion\n"
1317 "BAD occurance\nGOOD occurrence\n"
1318 "BAD occured\nGOOD occurred\n"
1319 "BAD occurence\nGOOD occurrence\n"
1320 "BAD occurrance\nGOOD occurrence\n"
1321 "BAD oclock\nGOOD o'clock\n"
1322 "BAD oculd\nGOOD could\n"
1323 "BAD ocur\nGOOD occur\n"
1324 "BAD oeprator\nGOOD operator\n"
1325 "BAD ofits\nGOOD of its\n"
1326 "BAD ofthe\nGOOD of the\n"
1327 "BAD oft he\nGOOD of the\n"
1328 "BAD oging\nGOOD going\n"
1329 "BAD ohter\nGOOD other\n"
1330 "BAD omre\nGOOD more\n"
1331 "BAD oneof\nGOOD one of\n"
1332 "BAD onepoint\nGOOD one point\n"
1333 "BAD onthe\nGOOD on the\n"
1334 "COMPLETE 0\nBAD ont he \nGOOD on the \n"
1335 "BAD onyl\nGOOD only\n"
1336 "BAD oppasite\nGOOD opposite\n"
1337 "BAD opperation\nGOOD operation\n"
1338 "BAD oppertunity\nGOOD opportunity\n"
1339 "BAD opposate\nGOOD opposite\n"
1340 "BAD opposible\nGOOD opposable\n"
1341 "BAD opposit\nGOOD opposite\n"
1342 "BAD oppotunities\nGOOD opportunities\n"
1343 "BAD oppotunity\nGOOD opportunity\n"
1344 "BAD orginization\nGOOD organization\n"
1345 "BAD orginized\nGOOD organized\n"
1346 "BAD otehr\nGOOD other\n"
1347 "BAD otu\nGOOD out\n"
1348 "BAD outof\nGOOD out of\n"
1349 "BAD overthe\nGOOD over the\n"
1350 "BAD owrk\nGOOD work\n"
1351 "BAD owuld\nGOOD would\n"
1352 "BAD oxident\nGOOD oxidant\n"
1353 "BAD papaer\nGOOD paper\n"
1354 "BAD passe\nGOOD pass\303\251\n"
1355 "BAD parliment\nGOOD parliament\n"
1356 "BAD partof\nGOOD part of\n"
1357 "BAD paymetn\nGOOD payment\n"
1358 "BAD paymetns\nGOOD payments\n"
1359 "BAD pciture\nGOOD picture\n"
1360 "BAD peice\nGOOD piece\n"
1361 "BAD peices\nGOOD pieces\n"
1362 "BAD peolpe\nGOOD people\n"
1363 "BAD peopel\nGOOD people\n"
1364 "BAD percentof\nGOOD percent of\n"
1365 "BAD percentto\nGOOD percent to\n"
1366 "BAD performence\nGOOD performance\n"
1367 "BAD perhasp\nGOOD perhaps\n"
1368 "BAD perhpas\nGOOD perhaps\n"
1369 "BAD permanant\nGOOD permanent\n"
1370 "BAD perminent\nGOOD permanent\n"
1371 "BAD personalyl\nGOOD personally\n"
1372 "BAD pleasent\nGOOD pleasant\n"
1373 "BAD pls\nGOOD please\n"
1374 "BAD plz\nGOOD please\n"
1375 "BAD poeple\nGOOD people\n"
1376 "BAD porblem\nGOOD problem\n"
1377 "BAD porblems\nGOOD problems\n"
1378 "BAD porvide\nGOOD provide\n"
1379 "BAD possable\nGOOD possible\n"
1380 "BAD postition\nGOOD position\n"
1381 "BAD potatoe\nGOOD potato\n"
1382 "BAD potatos\nGOOD potatoes\n"
1383 "BAD potentialy\nGOOD potentially\n"
1384 "BAD ppl\nGOOD people\n"
1385 "BAD pregnent\nGOOD pregnant\n"
1386 "BAD presance\nGOOD presence\n"
1387 "BAD primative\nGOOD primitive\n"
1388 "BAD probally\nGOOD probably\n"
1389 "BAD probelm\nGOOD problem\n"
1390 "BAD probelms\nGOOD problems\n"
1391 "BAD probly\nGOOD probably\n"
1392 "BAD prolly\nGOOD probably\n"
1393 "BAD proly\nGOOD probably\n"
1394 "BAD prominant\nGOOD prominent\n"
1395 "BAD proposterous\nGOOD preposterous\n"
1396 "BAD protege\nGOOD prot\303\251g\303\251\n"
1397 "BAD protoge\nGOOD prot\303\251g\303\251\n"
1398 "BAD psoition\nGOOD position\n"
1399 "BAD ptogress\nGOOD progress\n"
1400 "BAD pursuade\nGOOD persuade\n"
1401 "BAD puting\nGOOD putting\n"
1402 "BAD pwoer\nGOOD power\n"
1403 "BAD quater\nGOOD quarter\n"
1404 "BAD quaters\nGOOD quarters\n"
1405 "BAD quesion\nGOOD question\n"
1406 "BAD quesions\nGOOD questions\n"
1407 "BAD questioms\nGOOD questions\n"
1408 "BAD questiosn\nGOOD questions\n"
1409 "BAD questoin\nGOOD question\n"
1410 "BAD quetion\nGOOD question\n"
1411 "BAD quetions\nGOOD questions\n"
1412 "BAD r\nGOOD are\n"
1413 "BAD raeson\nGOOD reason\n"
1414 "BAD realyl\nGOOD really\n"
1415 "BAD reccomend\nGOOD recommend\n"
1416 "BAD reccommend\nGOOD recommend\n"
1417 "BAD receieve\nGOOD receive\n"
1418 "BAD recieve\nGOOD receive\n"
1419 "BAD recieved\nGOOD received\n"
1420 "BAD recieving\nGOOD receiving\n"
1421 "BAD recomend\nGOOD recommend\n"
1422 "BAD recomendation\nGOOD recommendation\n"
1423 "BAD recomendations\nGOOD recommendations\n"
1424 "BAD recomended\nGOOD recommended\n"
1425 "BAD reconize\nGOOD recognize\n"
1426 "BAD recrod\nGOOD record\n"
1427 "BAD rediculous\nGOOD ridiculous\n"
1428 "BAD rediculus\nGOOD ridiculous\n"
1429 "BAD reguard\nGOOD regard\n"
1430 "BAD religous\nGOOD religious\n"
1431 "BAD reluctent\nGOOD reluctant\n"
1432 "BAD remeber\nGOOD remember\n"
1433 "BAD reommend\nGOOD recommend\n"
1434 "BAD representativs\nGOOD representatives\n"
1435 "BAD representives\nGOOD representatives\n"
1436 "BAD represetned\nGOOD represented\n"
1437 "BAD represnt\nGOOD represent\n"
1438 "BAD reserach\nGOOD research\n"
1439 "BAD resollution\nGOOD resolution\n"
1440 "BAD resorces\nGOOD resources\n"
1441 "BAD respomd\nGOOD respond\n"
1442 "BAD respomse\nGOOD response\n"
1443 "BAD responce\nGOOD response\n"
1444 "BAD responsability\nGOOD responsibility\n"
1445 "BAD responsable\nGOOD responsible\n"
1446 "BAD responsibile\nGOOD responsible\n"
1447 "BAD responsiblity\nGOOD responsibility\n"
1448 "BAD restaraunt\nGOOD restaurant\n"
1449 "BAD restuarant\nGOOD restaurant\n"
1450 "BAD reult\nGOOD result\n"
1451 "BAD reveiw\nGOOD review\n"
1452 "BAD reveiwing\nGOOD reviewing\n"
1453 "BAD rumers\nGOOD rumors\n"
1454 "BAD rwite\nGOOD write\n"
1455 "BAD rythm\nGOOD rhythm\n"
1456 "BAD saidhe\nGOOD said he\n"
1457 "BAD saidit\nGOOD said it\n"
1458 "BAD saidthat\nGOOD said that\n"
1459 "BAD saidthe\nGOOD said the\n"
1460 "COMPLETE 0\nBAD saidt he \nGOOD said the \n"
1461 "BAD sandwhich\nGOOD sandwich\n"
1462 "BAD sandwitch\nGOOD sandwich\n"
1463 "BAD saturday\nGOOD Saturday\n"
1464 "BAD scedule\nGOOD schedule\n"
1465 "BAD sceduled\nGOOD scheduled\n"
1466 "BAD seance\nGOOD s\303\251ance\n"
1467 "BAD secratary\nGOOD secretary\n"
1468 "BAD sectino\nGOOD section\n"
1469 "BAD seh\nGOOD she\n"
1470 "BAD selectoin\nGOOD selection\n"
1471 "BAD sence\nGOOD sense\n"
1472 "BAD sentance\nGOOD sentence\n"
1473 "BAD separeate\nGOOD separate\n"
1474 "BAD seperate\nGOOD separate\n"
1475 "BAD sercumstances\nGOOD circumstances\n"
1476 "BAD shcool\nGOOD school\n"
1477 "COMPLETE 0\nBAD she;d \nGOOD she'd \n"
1478 "COMPLETE 0\nBAD she;ll \nGOOD she'll \n"
1479 "BAD shes\nGOOD she's\n"
1480 "COMPLETE 0\nBAD she;s \nGOOD she's \n"
1481 "BAD shesaid\nGOOD she said\n"
1482 "BAD shineing\nGOOD shining\n"
1483 "BAD shiped\nGOOD shipped\n"
1484 "BAD shoudl\nGOOD should\n"
1485 "COMPLETE 0\nBAD shoudln't \nGOOD shouldn't \n"
1486 "BAD shouldent\nGOOD shouldn't\n"
1487 "BAD shouldnt\nGOOD shouldn't\n"
1488 "COMPLETE 0\nBAD shouldn;t \nGOOD shouldn't \n"
1489 "COMPLETE 0\nBAD should of been\nGOOD should have been\n"
1490 "COMPLETE 0\nBAD should of had\nGOOD should have had\n"
1491 "BAD shouldve\nGOOD should've\n"
1492 "BAD showinf\nGOOD showing\n"
1493 "BAD signifacnt\nGOOD significant\n"
1494 "BAD simalar\nGOOD similar\n"
1495 "BAD similiar\nGOOD similar\n"
1496 "BAD simpyl\nGOOD simply\n"
1497 "BAD sincerly\nGOOD sincerely\n"
1498 "BAD sitll\nGOOD still\n"
1499 "BAD smae\nGOOD same\n"
1500 "BAD smoe\nGOOD some\n"
1501 "BAD soem\nGOOD some\n"
1502 "BAD sohw\nGOOD show\n"
1503 "BAD soical\nGOOD social\n"
1504 "BAD some1\nGOOD someone\n"
1505 "BAD somethign\nGOOD something\n"
1506 "BAD someting\nGOOD something\n"
1507 "BAD somewaht\nGOOD somewhat\n"
1508 "BAD somthing\nGOOD something\n"
1509 "BAD somtimes\nGOOD sometimes\n"
1510 "COMPLETE 0\nBAD sot hat \nGOOD so that \n"
1511 "BAD soudn\nGOOD sound\n"
1512 "BAD soudns\nGOOD sounds\n"
1513 "BAD speach\nGOOD speech\n"
1514 "BAD specificaly\nGOOD specifically\n"
1515 "BAD specificalyl\nGOOD specifically\n"
1516 "BAD spelt\nGOOD spelled\n"
1517 "BAD sry\nGOOD sorry\n"
1518 "COMPLETE 0\nBAD state of the ark\nGOOD state of the art\n"
1519 "BAD statment\nGOOD statement\n"
1520 "BAD statments\nGOOD statements\n"
1521 "BAD stnad\nGOOD stand\n"
1522 "BAD stopry\nGOOD story\n"
1523 "BAD stoyr\nGOOD story\n"
1524 "BAD stpo\nGOOD stop\n"
1525 "BAD strentgh\nGOOD strength\n"
1526 "BAD stroy\nGOOD story\n"
1527 "BAD struggel\nGOOD struggle\n"
1528 "BAD strugle\nGOOD struggle\n"
1529 "BAD studnet\nGOOD student\n"
1530 "BAD successfull\nGOOD successful\n"
1531 "BAD successfuly\nGOOD successfully\n"
1532 "BAD successfulyl\nGOOD successfully\n"
1533 "BAD sucess\nGOOD success\n"
1534 "BAD sucessfull\nGOOD successful\n"
1535 "BAD sufficiant\nGOOD sufficient\n"
1536 "BAD sum1\nGOOD someone\n"
1537 "BAD sunday\nGOOD Sunday\n"
1538 "BAD suposed\nGOOD supposed\n"
1539 "BAD supposably\nGOOD supposedly\n"
1540 "BAD suppossed\nGOOD supposed\n"
1541 "BAD suprise\nGOOD surprise\n"
1542 "BAD suprised\nGOOD surprised\n"
1543 "BAD sux\nGOOD sucks\n"
1544 "BAD swiming\nGOOD swimming\n"
1545 "BAD tahn\nGOOD than\n"
1546 "BAD taht\nGOOD that\n"
1547 "COMPLETE 0\nBAD take it for granite\nGOOD take it for granted\n"
1548 "COMPLETE 0\nBAD taken for granite\nGOOD taken for granted\n"
1549 "BAD talekd\nGOOD talked\n"
1550 "BAD talkign\nGOOD talking\n"
1551 "BAD tath\nGOOD that\n"
1552 "BAD tecnical\nGOOD technical\n"
1553 "BAD teh\nGOOD the\n"
1554 "BAD tehy\nGOOD they\n"
1555 "COMPLETE 0\nBAD tellt he \nGOOD tell the \n"
1556 "BAD termoil\nGOOD turmoil\n"
1557 "BAD tets\nGOOD test\n"
1558 "BAD tghe\nGOOD the\n"
1559 "BAD tghis\nGOOD this\n"
1560 "BAD thansk\nGOOD thanks\n"
1561 "BAD thanx\nGOOD thanks\n"
1562 "BAD thats\nGOOD that's\n"
1563 "BAD thatthe\nGOOD that the\n"
1564 "COMPLETE 0\nBAD thatt he \nGOOD that the \n"
1565 "BAD thecompany\nGOOD the company\n"
1566 "BAD thefirst\nGOOD the first\n"
1567 "BAD thegovernment\nGOOD the government\n"
1568 "COMPLETE 0\nBAD their are \nGOOD there are \n"
1569 "COMPLETE 0\nBAD their aren't \nGOOD there aren't \n"
1570 "COMPLETE 0\nBAD their is \nGOOD there is \n"
1571 "BAD themself\nGOOD themselves\n"
1572 "BAD themselfs\nGOOD themselves\n"
1573 "BAD thenew\nGOOD the new\n"
1574 "BAD theres\nGOOD there's\n"
1575 "COMPLETE 0\nBAD there's is \nGOOD theirs is \n"
1576 "COMPLETE 0\nBAD there's isn't \nGOOD theirs isn't \n"
1577 "BAD theri\nGOOD their\n"
1578 "BAD thesame\nGOOD the same\n"
1579 "BAD thetwo\nGOOD the two\n"
1580 "BAD theyd\nGOOD they'd\n"
1581 "COMPLETE 0\nBAD they;d \nGOOD they'd \n"
1582 "COMPLETE 0\nBAD they;l \nGOOD they'll \n"
1583 "BAD theyll\nGOOD they'll\n"
1584 "COMPLETE 0\nBAD they;ll \nGOOD they'll \n"
1585 "COMPLETE 0\nBAD they;r \nGOOD they're \n"
1586 "COMPLETE 0\nBAD theyre \nGOOD they're \n"
1587 "COMPLETE 0\nBAD they;re \nGOOD they're \n"
1588 "COMPLETE 0\nBAD they're are \nGOOD there are \n"
1589 "COMPLETE 0\nBAD they're is \nGOOD there is \n"
1590 "COMPLETE 0\nBAD they;v \nGOOD they've \n"
1591 "BAD theyve\nGOOD they've\n"
1592 "COMPLETE 0\nBAD they;ve \nGOOD they've \n"
1593 "BAD thgat\nGOOD that\n"
1594 "BAD thge\nGOOD the\n"
1595 "BAD thier\nGOOD their \n"
1596 "BAD thigsn\nGOOD things\n"
1597 "BAD thisyear\nGOOD this year\n"
1598 "BAD thme\nGOOD them\n"
1599 "BAD thna\nGOOD than\n"
1600 "BAD thne\nGOOD then\n"
1601 "BAD thnig\nGOOD thing\n"
1602 "BAD thnigs\nGOOD things\n"
1603 "BAD tho\nGOOD though\n"
1604 "BAD threatend\nGOOD threatened\n"
1605 "BAD thsi\nGOOD this\n"
1606 "BAD thsoe\nGOOD those\n"
1607 "BAD thta\nGOOD that\n"
1608 "BAD thursday\nGOOD Thursday\n"
1609 "BAD thx\nGOOD thanks\n"
1610 "BAD tihs\nGOOD this\n"
1611 "BAD timne\nGOOD time\n"
1612 "BAD tiogether\nGOOD together\n"
1613 "BAD tje\nGOOD the\n"
1614 "BAD tjhe\nGOOD the\n"
1615 "BAD tkae\nGOOD take\n"
1616 "BAD tkaes\nGOOD takes\n"
1617 "BAD tkaing\nGOOD taking\n"
1618 "BAD tlaking\nGOOD talking\n"
1619 "BAD tnx\nGOOD thanks\n"
1620 "BAD todya\nGOOD today\n"
1621 "BAD togehter\nGOOD together\n"
1622 "COMPLETE 0\nBAD toldt he \nGOOD told the \n"
1623 "BAD tomorow\nGOOD tomorrow\n"
1624 "BAD tongiht\nGOOD tonight\n"
1625 "BAD tonihgt\nGOOD tonight\n"
1626 "BAD tonite\nGOOD tonight\n"
1627 "BAD totaly\nGOOD totally\n"
1628 "BAD totalyl\nGOOD totally\n"
1629 "BAD tothe\nGOOD to the\n"
1630 "COMPLETE 0\nBAD tot he \nGOOD to the \n"
1631 "BAD touche\nGOOD touch\303\251\n"
1632 "BAD towrad\nGOOD toward\n"
1633 "BAD traditionalyl\nGOOD traditionally\n"
1634 "BAD transfered\nGOOD transferred\n"
1635 "BAD truely\nGOOD truly\n"
1636 "BAD truley\nGOOD truly\n"
1637 "BAD tryed\nGOOD tried\n"
1638 "BAD tthe\nGOOD the\n"
1639 "BAD tuesday\nGOOD Tuesday\n"
1640 "BAD tyhat\nGOOD that\n"
1641 "BAD tyhe\nGOOD the\n"
1642 "BAD u\nGOOD you\n"
1643 "BAD udnerstand\nGOOD understand\n"
1644 "BAD understnad\nGOOD understand\n"
1645 "COMPLETE 0\nBAD undert he \nGOOD under the \n"
1646 "BAD unforseen\nGOOD unforeseen\n"
1647 "BAD UnitedStates\nGOOD United States\n"
1648 "BAD unliek\nGOOD unlike\n"
1649 "BAD unpleasently\nGOOD unpleasantly\n"
1650 "BAD untill\nGOOD until\n"
1651 "BAD untilll\nGOOD until\n"
1652 "BAD ur\nGOOD you are\n"
1653 "BAD useing\nGOOD using\n"
1654 "BAD usualyl\nGOOD usually\n"
1655 "BAD veyr\nGOOD very\n"
1656 "BAD virtualyl\nGOOD virtually\n"
1657 "BAD visavis\nGOOD vis-a-vis\n"
1658 "COMPLETE 0\nBAD vis-a-vis\nGOOD vis-\303\240-vis\n"
1659 "BAD vrey\nGOOD very\n"
1660 "BAD vulnerible\nGOOD vulnerable\n"
1661 "BAD waht\nGOOD what\n"
1662 "BAD warrent\nGOOD warrant\n"
1663 "COMPLETE 0\nBAD wa snot \nGOOD was not \n"
1664 "COMPLETE 0\nBAD wasnt \nGOOD wasn't \n"
1665 "COMPLETE 0\nBAD wasn;t \nGOOD wasn't \n"
1666 "BAD wat\nGOOD what\n"
1667 "BAD watn\nGOOD want\n"
1668 "COMPLETE 0\nBAD we;d \nGOOD we'd \n"
1669 "BAD wednesday\nGOOD Wednesday\n"
1670 "BAD wehn\nGOOD when\n"
1671 "COMPLETE 0\nBAD we'l \nGOOD we'll \n"
1672 "COMPLETE 0\nBAD we;ll \nGOOD we'll \n"
1673 "COMPLETE 0\nBAD we;re \nGOOD we're \n"
1674 "BAD werent\nGOOD weren't\n"
1675 "COMPLETE 0\nBAD weren;t \nGOOD weren't \n"
1676 "COMPLETE 0\nBAD wern't \nGOOD weren't \n"
1677 "BAD werre\nGOOD were\n"
1678 "BAD weve\nGOOD we've\n"
1679 "COMPLETE 0\nBAD we;ve \nGOOD we've \n"
1680 "BAD whats\nGOOD what's\n"
1681 "COMPLETE 0\nBAD what;s \nGOOD what's \n"
1682 "BAD whcih\nGOOD which\n"
1683 "COMPLETE 0\nBAD whent he \nGOOD when the \n"
1684 "BAD wheres\nGOOD where's\n"
1685 "COMPLETE 0\nBAD where;s \nGOOD where's \n"
1686 "BAD wherre\nGOOD where\n"
1687 "BAD whic\nGOOD which\n"
1688 "COMPLETE 0\nBAD whicht he \nGOOD which the \n"
1689 "BAD whihc\nGOOD which\n"
1690 "BAD wholl\nGOOD who'll\n"
1691 "BAD whos\nGOOD who's\n"
1692 "COMPLETE 0\nBAD who;s \nGOOD who's \n"
1693 "BAD whove\nGOOD who've\n"
1694 "COMPLETE 0\nBAD who;ve \nGOOD who've \n"
1695 "BAD whta\nGOOD what\n"
1696 "BAD whys\nGOOD why's\n"
1697 "BAD wief\nGOOD wife\n"
1698 "BAD wierd\nGOOD weird\n"
1699 "BAD wihch\nGOOD which\n"
1700 "BAD wiht\nGOOD with\n"
1701 "BAD willbe\nGOOD will be\n"
1702 "COMPLETE 0\nBAD will of been\nGOOD will have been\n"
1703 "COMPLETE 0\nBAD will of had\nGOOD will have had\n"
1704 "BAD windoes\nGOOD windows\n"
1705 "BAD witha\nGOOD with a\n"
1706 "BAD withdrawl\nGOOD withdrawal\n"
1707 "BAD withe\nGOOD with\n"
1708 "COMPLETE 0\nBAD withthe \nGOOD with the \n"
1709 "BAD witht he\nGOOD with the\n"
1710 "BAD wiull\nGOOD will\n"
1711 "BAD wnat\nGOOD want\n"
1712 "BAD wnated\nGOOD wanted\n"
1713 "BAD wnats\nGOOD wants\n"
1714 "BAD woh\nGOOD who\n"
1715 "BAD wohle\nGOOD whole\n"
1716 "BAD wokr\nGOOD work\n"
1717 "BAD wont\nGOOD won't\n"
1718 "COMPLETE 0\nBAD wo'nt \nGOOD won't \n"
1719 "COMPLETE 0\nBAD won;t \nGOOD won't \n"
1720 "BAD woudl\nGOOD would\n"
1721 "COMPLETE 0\nBAD woudln't \nGOOD wouldn't \n"
1722 "BAD wouldbe\nGOOD would be\n"
1723 "BAD wouldnt\nGOOD wouldn't\n"
1724 "COMPLETE 0\nBAD wouldn;t \nGOOD wouldn't \n"
1725 "COMPLETE 0\nBAD would of been\nGOOD would have been\n"
1726 "COMPLETE 0\nBAD would of had\nGOOD would have had\n"
1727 "BAD wouldve\nGOOD would've\n"
1728 "BAD wriet\nGOOD write\n"
1729 "BAD writting\nGOOD writing\n"
1730 "BAD wrod\nGOOD word\n"
1731 "BAD wroet\nGOOD wrote\n"
1732 "BAD wroking\nGOOD working\n"
1733 "BAD wtih\nGOOD with\n"
1734 "BAD wuould\nGOOD would\n"
1735 "BAD wut\nGOOD what\n"
1736 "BAD wya\nGOOD way\n"
1737 "BAD y\nGOOD why\n"
1738 "BAD yeh\nGOOD yeah\n"
1739 "BAD yera\nGOOD year\n"
1740 "BAD yeras\nGOOD years\n"
1741 "BAD yersa\nGOOD years\n"
1742 "BAD yoiu\nGOOD you\n"
1743 "BAD youare\nGOOD you are\n"
1744 "BAD youd\nGOOD you'd\n"
1745 "COMPLETE 0\nBAD you;d \nGOOD you'd \n"
1746 "BAD youll\nGOOD you'll\n"
1747 "COMPLETE 0\nBAD your a \nGOOD you're a \n"
1748 "COMPLETE 0\nBAD your an \nGOOD you're an \n"
1749 "BAD youre\nGOOD you're\n"
1750 "COMPLETE 0\nBAD you;re \nGOOD you're \n"
1751 "COMPLETE 0\nBAD you're own \nGOOD your own \n"
1752 "COMPLETE 0\nBAD your her \nGOOD you're her \n"
1753 "COMPLETE 0\nBAD your here \nGOOD you're here \n"
1754 "COMPLETE 0\nBAD your his \nGOOD you're his \n"
1755 "COMPLETE 0\nBAD your my \nGOOD you're my \n"
1756 "COMPLETE 0\nBAD your the \nGOOD you're the \n"
1757 "COMPLETE 0\nBAD your their \nGOOD you're their \n"
1758 "COMPLETE 0\nBAD your your \nGOOD you're your \n"
1759 "BAD youve\nGOOD you've\n"
1760 "COMPLETE 0\nBAD you;ve \nGOOD you've \n"
1761 "BAD ytou\nGOOD you\n"
1762 "BAD yuo\nGOOD you\n"
1763 "BAD yuor\nGOOD your\n";
1764 gchar *buf;
1765 gchar *ibuf;
1766 GHashTable *hashes;
1767 char bad[82] = "";
1768 char good[256] = "";
1769 int pnt = 0;
1770 gsize size;
1771 gboolean complete = TRUE;
1772 gboolean case_sensitive = FALSE;
1774 buf = g_build_filename(purple_user_dir(), "dict", NULL);
1775 g_file_get_contents(buf, &ibuf, &size, NULL);
1776 g_free(buf);
1777 if (!ibuf) {
1778 ibuf = g_strdup(defaultconf);
1779 size = strlen(defaultconf);
1782 model = gtk_list_store_new((gint)N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
1783 hashes = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
1785 while (buf_get_line(ibuf, &buf, &pnt, size)) {
1786 if (*buf != '#') {
1787 if (!g_ascii_strncasecmp(buf, "BAD ", 4))
1789 strncpy(bad, buf + 4, 81);
1791 else if(!g_ascii_strncasecmp(buf, "CASE ", 5))
1793 case_sensitive = *(buf+5) == '0' ? FALSE : TRUE;
1795 else if(!g_ascii_strncasecmp(buf, "COMPLETE ", 9))
1797 complete = *(buf+9) == '0' ? FALSE : TRUE;
1799 else if (!g_ascii_strncasecmp(buf, "GOOD ", 5))
1801 strncpy(good, buf + 5, 255);
1803 if (*bad && *good && g_hash_table_lookup(hashes, bad) == NULL) {
1804 GtkTreeIter iter;
1806 /* We don't actually need to store the good string, since this
1807 * hash is just being used to eliminate duplicate bad strings.
1808 * The value has to be non-NULL so the lookup above will work.
1810 g_hash_table_insert(hashes, g_strdup(bad), GINT_TO_POINTER(1));
1812 if (!complete)
1813 case_sensitive = TRUE;
1815 gtk_list_store_append(model, &iter);
1816 gtk_list_store_set(model, &iter,
1817 BAD_COLUMN, bad,
1818 GOOD_COLUMN, good,
1819 WORD_ONLY_COLUMN, complete,
1820 CASE_SENSITIVE_COLUMN, case_sensitive,
1821 -1);
1823 bad[0] = '\0';
1824 complete = TRUE;
1825 case_sensitive = FALSE;
1829 g_free(ibuf);
1830 g_hash_table_destroy(hashes);
1832 gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model),
1833 0, GTK_SORT_ASCENDING);
1836 static GtkWidget *tree;
1837 static GtkWidget *bad_entry;
1838 static GtkWidget *good_entry;
1839 static GtkWidget *complete_toggle;
1840 static GtkWidget *case_toggle;
1842 static void save_list(void);
1844 static void on_edited(GtkCellRendererText *cellrenderertext,
1845 gchar *path, gchar *arg2, gpointer data)
1847 GtkTreeIter iter;
1848 GValue val;
1850 if (arg2[0] == '\0') {
1851 gdk_beep();
1852 return;
1855 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path));
1856 val.g_type = 0;
1857 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GPOINTER_TO_INT(data), &val);
1859 if (strcmp(arg2, g_value_get_string(&val))) {
1860 gtk_list_store_set(model, &iter, GPOINTER_TO_INT(data), arg2, -1);
1861 save_list();
1863 g_value_unset(&val);
1867 static void word_only_toggled(GtkCellRendererToggle *cellrenderertoggle,
1868 gchar *path, gpointer data){
1869 GtkTreeIter iter;
1870 gboolean enabled;
1872 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path));
1873 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter,
1874 WORD_ONLY_COLUMN, &enabled,
1875 -1);
1877 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
1878 WORD_ONLY_COLUMN, !enabled,
1879 -1);
1881 /* I want to be sure that the above change has happened to the GtkTreeView first. */
1882 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
1883 CASE_SENSITIVE_COLUMN, enabled,
1884 -1);
1886 save_list();
1889 static void case_sensitive_toggled(GtkCellRendererToggle *cellrenderertoggle,
1890 gchar *path, gpointer data){
1891 GtkTreeIter iter;
1892 gboolean enabled;
1894 g_return_if_fail(gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(model), &iter, path));
1896 /* Prevent the case sensitive column from changing on non-whole word replacements.
1897 * Ideally, the column would be set insensitive in the word_only_toggled callback. */
1898 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter,
1899 WORD_ONLY_COLUMN, &enabled,
1900 -1);
1901 if (!enabled)
1902 return;
1904 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter,
1905 CASE_SENSITIVE_COLUMN, &enabled,
1906 -1);
1908 gtk_list_store_set(GTK_LIST_STORE(model), &iter,
1909 CASE_SENSITIVE_COLUMN, !enabled,
1910 -1);
1912 save_list();
1915 static void list_add_new()
1917 GtkTreeIter iter;
1918 const char *word = gtk_entry_get_text(GTK_ENTRY(bad_entry));
1919 gboolean case_sensitive = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(case_toggle));
1921 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) {
1922 char *tmpword = g_utf8_casefold(word, -1);
1924 do {
1925 GValue bad_val;
1926 gboolean match;
1928 bad_val.g_type = 0;
1929 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, BAD_COLUMN, &bad_val);
1931 if (case_sensitive)
1933 GValue case_sensitive_val;
1934 case_sensitive_val.g_type = 0;
1935 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, CASE_SENSITIVE_COLUMN, &case_sensitive_val);
1937 /* If they're both case-sensitive, then compare directly.
1938 * Otherwise, they overlap. */
1939 if (g_value_get_boolean(&case_sensitive_val))
1941 match = !strcmp(g_value_get_string(&bad_val), word);
1943 else
1945 char *bad = g_utf8_casefold(g_value_get_string(&bad_val), -1);
1946 match = !strcmp(bad, tmpword);
1947 g_free(bad);
1949 g_value_unset(&case_sensitive_val);
1951 else
1953 char *bad = g_utf8_casefold(g_value_get_string(&bad_val), -1);
1954 match = !strcmp(bad, tmpword);
1955 g_free(bad);
1958 if (match) {
1959 g_value_unset(&bad_val);
1960 g_free(tmpword);
1962 purple_notify_error(NULL, _("Duplicate Correction"),
1963 _("The specified word already exists in the correction list."),
1964 gtk_entry_get_text(GTK_ENTRY(bad_entry)));
1965 return;
1968 g_value_unset(&bad_val);
1970 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
1972 g_free(tmpword);
1976 gtk_list_store_append(model, &iter);
1977 gtk_list_store_set(model, &iter,
1978 BAD_COLUMN, word,
1979 GOOD_COLUMN, gtk_entry_get_text(GTK_ENTRY(good_entry)),
1980 WORD_ONLY_COLUMN, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(complete_toggle)),
1981 CASE_SENSITIVE_COLUMN, case_sensitive,
1982 -1);
1984 gtk_editable_delete_text(GTK_EDITABLE(bad_entry), 0, -1);
1985 gtk_editable_delete_text(GTK_EDITABLE(good_entry), 0, -1);
1986 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(complete_toggle), TRUE);
1987 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(case_toggle), FALSE);
1988 gtk_widget_grab_focus(bad_entry);
1990 save_list();
1993 static void add_selected_row_to_list(GtkTreeModel *model, GtkTreePath *path,
1994 GtkTreeIter *iter, gpointer data)
1996 GtkTreeRowReference *row_reference;
1997 GSList **list = (GSList **)data;
1998 row_reference = gtk_tree_row_reference_new(model, path);
1999 *list = g_slist_prepend(*list, row_reference);
2002 static void remove_row(void *data1, gpointer data2)
2004 GtkTreeRowReference *row_reference;
2005 GtkTreePath *path;
2006 GtkTreeIter iter;
2008 row_reference = (GtkTreeRowReference *)data1;
2009 path = gtk_tree_row_reference_get_path(row_reference);
2011 if (gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path))
2012 gtk_list_store_remove(model, &iter);
2014 gtk_tree_path_free(path);
2015 gtk_tree_row_reference_free(row_reference);
2018 static void list_delete()
2020 GtkTreeSelection *sel;
2021 GSList *list = NULL;
2023 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
2024 gtk_tree_selection_selected_foreach(sel, add_selected_row_to_list, &list);
2026 g_slist_foreach(list, remove_row, NULL);
2027 g_slist_free(list);
2029 save_list();
2032 static void save_list()
2034 GString *data;
2035 GtkTreeIter iter;
2037 data = g_string_new("");
2039 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(model), &iter)) {
2040 do {
2041 GValue val0;
2042 GValue val1;
2043 GValue val2;
2044 GValue val3;
2046 val0.g_type = 0;
2047 val1.g_type = 0;
2048 val2.g_type = 0;
2049 val3.g_type = 0;
2051 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, BAD_COLUMN, &val0);
2052 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, GOOD_COLUMN, &val1);
2053 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, WORD_ONLY_COLUMN, &val2);
2054 gtk_tree_model_get_value(GTK_TREE_MODEL(model), &iter, CASE_SENSITIVE_COLUMN, &val3);
2056 g_string_append_printf(data, "COMPLETE %d\nCASE %d\nBAD %s\nGOOD %s\n\n",
2057 g_value_get_boolean(&val2),
2058 g_value_get_boolean(&val3),
2059 g_value_get_string(&val0),
2060 g_value_get_string(&val1));
2062 g_value_unset(&val0);
2063 g_value_unset(&val1);
2064 g_value_unset(&val2);
2065 g_value_unset(&val3);
2067 } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter));
2070 purple_util_write_data_to_file("dict", data->str, -1);
2072 g_string_free(data, TRUE);
2075 #if !GTK_CHECK_VERSION(2,2,0)
2076 static void
2077 count_selected_helper(GtkTreeModel *model, GtkTreePath *path,
2078 GtkTreeIter *iter, gpointer user_data)
2080 (*(gint *)user_data)++;
2082 #endif
2084 static void on_selection_changed(GtkTreeSelection *sel,
2085 gpointer data)
2087 gint num_selected;
2088 #if GTK_CHECK_VERSION(2,2,0)
2089 num_selected = gtk_tree_selection_count_selected_rows(sel);
2090 #else
2091 gtk_tree_selection_selected_foreach(sel, count_selected_helper, &num_selected);
2092 #endif
2093 gtk_widget_set_sensitive((GtkWidget*)data, (num_selected > 0));
2096 static gboolean non_empty(const char *s)
2098 while (*s && g_ascii_isspace(*s))
2099 s++;
2100 return *s;
2103 static void on_entry_changed(GtkEditable *editable, gpointer data)
2105 gtk_widget_set_sensitive((GtkWidget*)data,
2106 non_empty(gtk_entry_get_text(GTK_ENTRY(bad_entry))) &&
2107 non_empty(gtk_entry_get_text(GTK_ENTRY(good_entry))));
2111 * EXPORTED FUNCTIONS
2114 static gboolean
2115 plugin_load(PurplePlugin *plugin)
2117 void *conv_handle = purple_conversations_get_handle();
2118 GList *convs;
2120 load_conf();
2122 /* Attach to existing conversations */
2123 for (convs = purple_get_conversations(); convs != NULL; convs = convs->next)
2125 spellchk_new_attach((PurpleConversation *)convs->data);
2128 purple_signal_connect(conv_handle, "conversation-created",
2129 plugin, PURPLE_CALLBACK(spellchk_new_attach), NULL);
2131 return TRUE;
2134 static gboolean
2135 plugin_unload(PurplePlugin *plugin)
2137 GList *convs;
2139 /* Detach from existing conversations */
2140 for (convs = purple_get_conversations(); convs != NULL; convs = convs->next)
2142 PidginConversation *gtkconv = PIDGIN_CONVERSATION((PurpleConversation *)convs->data);
2143 spellchk *spell = g_object_get_data(G_OBJECT(gtkconv->entry), SPELLCHK_OBJECT_KEY);
2145 g_signal_handlers_disconnect_by_func(gtkconv->entry, message_send_cb, spell);
2146 g_object_set_data(G_OBJECT(gtkconv->entry), SPELLCHK_OBJECT_KEY, NULL);
2149 return TRUE;
2152 static void whole_words_button_toggled(GtkToggleButton *complete_toggle, GtkToggleButton *case_toggle)
2154 gboolean enabled = gtk_toggle_button_get_active(complete_toggle);
2156 gtk_toggle_button_set_active(case_toggle, !enabled);
2157 gtk_widget_set_sensitive(GTK_WIDGET(case_toggle), enabled);
2160 static GtkWidget *
2161 get_config_frame(PurplePlugin *plugin)
2163 GtkWidget *ret, *vbox, *win;
2164 GtkWidget *hbox, *label;
2165 GtkWidget *button;
2166 GtkSizeGroup *sg;
2167 GtkSizeGroup *sg2;
2168 GtkCellRenderer *renderer;
2169 GtkTreeViewColumn *column;
2170 GtkWidget *vbox2;
2171 GtkWidget *hbox2;
2172 GtkWidget *vbox3;
2174 ret = gtk_vbox_new(FALSE, PIDGIN_HIG_CAT_SPACE);
2175 gtk_container_set_border_width (GTK_CONTAINER(ret), PIDGIN_HIG_BORDER);
2177 vbox = pidgin_make_frame(ret, _("Text Replacements"));
2178 gtk_container_set_border_width(GTK_CONTAINER(vbox), 4);
2179 gtk_widget_show(vbox);
2181 win = gtk_scrolled_window_new(0, 0);
2182 gtk_box_pack_start(GTK_BOX(vbox), win, TRUE, TRUE, 0);
2183 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(win),
2184 GTK_SHADOW_IN);
2185 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(win),
2186 GTK_POLICY_NEVER,
2187 GTK_POLICY_ALWAYS);
2188 gtk_widget_show(win);
2190 tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
2191 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(tree), TRUE);
2192 gtk_widget_set_size_request(tree, -1, 200);
2194 renderer = gtk_cell_renderer_text_new();
2195 g_object_set(G_OBJECT(renderer),
2196 "editable", TRUE,
2197 NULL);
2198 g_signal_connect(G_OBJECT(renderer), "edited",
2199 G_CALLBACK(on_edited), GINT_TO_POINTER(0));
2200 column = gtk_tree_view_column_new_with_attributes(_("You type"), renderer,
2201 "text", BAD_COLUMN,
2202 NULL);
2203 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
2204 gtk_tree_view_column_set_fixed_width(column, 150);
2205 gtk_tree_view_column_set_resizable(column, TRUE);
2206 gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
2208 renderer = gtk_cell_renderer_text_new();
2209 g_object_set(G_OBJECT(renderer),
2210 "editable", TRUE,
2211 NULL);
2212 g_signal_connect(G_OBJECT(renderer), "edited",
2213 G_CALLBACK(on_edited), GINT_TO_POINTER(1));
2214 column = gtk_tree_view_column_new_with_attributes(_("You send"), renderer,
2215 "text", GOOD_COLUMN,
2216 NULL);
2217 gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
2218 gtk_tree_view_column_set_fixed_width(column, 150);
2219 gtk_tree_view_column_set_resizable(column, TRUE);
2220 gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
2222 renderer = gtk_cell_renderer_toggle_new();
2223 g_object_set(G_OBJECT(renderer),
2224 "activatable", TRUE,
2225 NULL);
2226 g_signal_connect(G_OBJECT(renderer), "toggled",
2227 G_CALLBACK(word_only_toggled), NULL);
2228 column = gtk_tree_view_column_new_with_attributes(_("Whole words only"), renderer,
2229 "active", WORD_ONLY_COLUMN,
2230 NULL);
2231 gtk_tree_view_column_set_resizable(column, TRUE);
2232 gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
2234 renderer = gtk_cell_renderer_toggle_new();
2235 g_object_set(G_OBJECT(renderer),
2236 "activatable", TRUE,
2237 NULL);
2238 g_signal_connect(G_OBJECT(renderer), "toggled",
2239 G_CALLBACK(case_sensitive_toggled), NULL);
2240 column = gtk_tree_view_column_new_with_attributes(_("Case sensitive"), renderer,
2241 "active", CASE_SENSITIVE_COLUMN,
2242 NULL);
2243 gtk_tree_view_column_set_resizable(column, TRUE);
2244 gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
2246 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)),
2247 GTK_SELECTION_MULTIPLE);
2248 gtk_container_add(GTK_CONTAINER(win), tree);
2249 gtk_widget_show(tree);
2251 hbox = gtk_hbutton_box_new();
2252 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
2253 gtk_widget_show(hbox);
2255 button = gtk_button_new_from_stock(GTK_STOCK_DELETE);
2256 g_signal_connect(G_OBJECT(button), "clicked",
2257 G_CALLBACK(list_delete), NULL);
2258 gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
2259 gtk_widget_set_sensitive(button, FALSE);
2261 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree))),
2262 "changed", G_CALLBACK(on_selection_changed), button);
2264 gtk_widget_show(button);
2266 vbox = pidgin_make_frame(ret, _("Add a new text replacement"));
2268 hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
2269 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
2270 gtk_widget_show(hbox);
2271 vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
2272 gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
2273 gtk_widget_show(vbox2);
2275 sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
2276 sg2 = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
2278 hbox2 = gtk_hbox_new(FALSE, 2);
2279 gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 0);
2280 gtk_widget_show(hbox2);
2282 label = gtk_label_new_with_mnemonic(_("You _type:"));
2283 gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
2284 gtk_size_group_add_widget(sg, label);
2285 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
2287 bad_entry = gtk_entry_new();
2288 /* Set a minimum size. Since they're in a size group, the other entry will match up. */
2289 gtk_widget_set_size_request(bad_entry, 350, -1);
2290 gtk_box_pack_start(GTK_BOX(hbox2), bad_entry, TRUE, TRUE, 0);
2291 gtk_size_group_add_widget(sg2, bad_entry);
2292 gtk_label_set_mnemonic_widget(GTK_LABEL(label), bad_entry);
2293 gtk_widget_show(bad_entry);
2295 hbox2 = gtk_hbox_new(FALSE, 2);
2296 gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 0);
2297 gtk_widget_show(hbox2);
2299 label = gtk_label_new_with_mnemonic(_("You _send:"));
2300 gtk_box_pack_start(GTK_BOX(hbox2), label, FALSE, FALSE, 0);
2301 gtk_size_group_add_widget(sg, label);
2302 gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
2304 good_entry = gtk_entry_new();
2305 gtk_box_pack_start(GTK_BOX(hbox2), good_entry, TRUE, TRUE, 0);
2306 gtk_size_group_add_widget(sg2, good_entry);
2307 gtk_label_set_mnemonic_widget(GTK_LABEL(label), good_entry);
2308 gtk_widget_show(good_entry);
2310 /* Created here so it can be passed to whole_words_button_toggled. */
2311 case_toggle = gtk_check_button_new_with_mnemonic(_("_Exact case match (uncheck for automatic case handling)"));
2313 complete_toggle = gtk_check_button_new_with_mnemonic(_("Only replace _whole words"));
2314 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(complete_toggle), TRUE);
2315 g_signal_connect(G_OBJECT(complete_toggle), "clicked",
2316 G_CALLBACK(whole_words_button_toggled), case_toggle);
2317 gtk_widget_show(complete_toggle);
2318 gtk_box_pack_start(GTK_BOX(vbox2), complete_toggle, FALSE, FALSE, 0);
2320 /* The button is created above so it can be passed to whole_words_button_toggled. */
2321 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(case_toggle), FALSE);
2322 gtk_widget_show(case_toggle);
2323 gtk_box_pack_start(GTK_BOX(vbox2), case_toggle, FALSE, FALSE, 0);
2325 button = gtk_button_new_from_stock(GTK_STOCK_ADD);
2326 g_signal_connect(G_OBJECT(button), "clicked",
2327 G_CALLBACK(list_add_new), NULL);
2328 vbox3 = gtk_vbox_new(FALSE, 0);
2329 gtk_box_pack_start(GTK_BOX(hbox), vbox3, TRUE, FALSE, 0);
2330 gtk_widget_show(vbox3);
2331 gtk_box_pack_end(GTK_BOX(vbox3), button, FALSE, FALSE, 0);
2332 g_signal_connect(G_OBJECT(bad_entry), "changed", G_CALLBACK(on_entry_changed), button);
2333 g_signal_connect(G_OBJECT(good_entry), "changed", G_CALLBACK(on_entry_changed), button);
2334 gtk_widget_set_sensitive(button, FALSE);
2335 gtk_widget_show(button);
2337 #if 0
2338 vbox = pidgin_make_frame(ret, _("General Text Replacement Options"));
2339 pidgin_prefs_checkbox(_("Enable replacement of last word on send"),
2340 "/plugins/gtk/spellchk/last_word_replace", vbox);
2341 #endif
2343 gtk_widget_show_all(ret);
2344 return ret;
2347 static PidginPluginUiInfo ui_info =
2349 get_config_frame,
2350 0, /* page_num (Reserved) */
2352 /* padding */
2353 NULL,
2354 NULL,
2355 NULL,
2356 NULL
2359 static PurplePluginInfo info =
2361 PURPLE_PLUGIN_MAGIC,
2362 PURPLE_MAJOR_VERSION,
2363 PURPLE_MINOR_VERSION,
2364 PURPLE_PLUGIN_STANDARD,
2365 PIDGIN_PLUGIN_TYPE,
2367 NULL,
2368 PURPLE_PRIORITY_DEFAULT,
2369 SPELLCHECK_PLUGIN_ID,
2370 N_("Text replacement"),
2371 VERSION,
2372 N_("Replaces text in outgoing messages according to user-defined rules."),
2373 N_("Replaces text in outgoing messages according to user-defined rules."),
2374 "Eric Warmenhoven <eric@warmenhoven.org>",
2375 PURPLE_WEBSITE,
2376 plugin_load,
2377 plugin_unload,
2378 NULL,
2379 &ui_info,
2380 NULL,
2381 NULL,
2382 NULL,
2384 /* padding */
2385 NULL,
2386 NULL,
2387 NULL,
2388 NULL
2391 static void
2392 init_plugin(PurplePlugin *plugin)
2394 #if 0
2395 purple_prefs_add_none("/plugins");
2396 purple_prefs_add_none("/plugins/gtk");
2397 purple_prefs_add_none("/plugins/gtk/spellchk");
2398 purple_prefs_add_bool("/plugins/gtk/spellchk/last_word_replace", TRUE);
2399 #endif
2402 PURPLE_INIT_PLUGIN(spellcheck, init_plugin, info)