comparison runtime/doc/spell.txt @ 625:81fe2ccc1207 v7.0179

updated for version 7.0179
author vimboss
date Thu, 12 Jan 2006 23:22:24 +0000
parents 91e7d4a7b3b0
children 732c7ae5743e
comparison
equal deleted inserted replaced
624:91e7d4a7b3b0 625:81fe2ccc1207
1 *spell.txt* For Vim version 7.0aa. Last change: 2005 Dec 29 1 *spell.txt* For Vim version 7.0aa. Last change: 2006 Jan 11
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
170 starts with a capital. This doesn't work for the first word in the file. 170 starts with a capital. This doesn't work for the first word in the file.
171 When there is a line break right after a sentence the highlighting of the next 171 When there is a line break right after a sentence the highlighting of the next
172 line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for 172 line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for
173 how it can be set automatically when 'spelllang' is set. 173 how it can be set automatically when 'spelllang' is set.
174 174
175 Vim counts the number of times a good word is encountered. This is used to
176 sort the suggestions: words that have been seen before get a small bonus,
177 words that have been seen often get a bigger bonus. The COMMON item in the
178 affix file can be used to define common words, so that this mechanism also
179 works in a new or short file |spell-COMMON|.
180
175 ============================================================================== 181 ==============================================================================
176 2. Remarks on spell checking *spell-remarks* 182 2. Remarks on spell checking *spell-remarks*
177 183
178 PERFORMANCE 184 PERFORMANCE
179 185
293 Spelling for EBCDIC is currently not supported. 299 Spelling for EBCDIC is currently not supported.
294 300
295 A spell file might not be available in the current 'encoding'. See 301 A spell file might not be available in the current 'encoding'. See
296 |spell-mkspell| about how to create a spell file. Converting a spell file 302 |spell-mkspell| about how to create a spell file. Converting a spell file
297 with "iconv" will NOT work! 303 with "iconv" will NOT work!
304
305 *spell-sug-file*
306 If there is a file with exactly the same name as the ".spl" file but ending in
307 ".sug", that file will be used for giving better suggestions. It isn't loaded
308 before suggestions are made to reduce memory use.
298 309
299 *E758* *E759* 310 *E758* *E759*
300 When loading a spell file Vim checks that it is properly formatted. If you 311 When loading a spell file Vim checks that it is properly formatted. If you
301 get an error the file may be truncated, modified or intended for another Vim 312 get an error the file may be truncated, modified or intended for another Vim
302 version. 313 version.
529 :spelld[ump] Open a new window and fill it with all currently valid 540 :spelld[ump] Open a new window and fill it with all currently valid
530 words. Compound words are not included. 541 words. Compound words are not included.
531 Note: For some languages the result may be enormous, 542 Note: For some languages the result may be enormous,
532 causing Vim to run out of memory. 543 causing Vim to run out of memory.
533 544
545 :spelld[ump]! Like ":spelldump" and include the word count. This is
546 the number of times the word was found while
547 updating the screen. Words that are in COMMON items
548 get a starting count of 10.
549
534 The format of the word list is used |spell-wordlist-format|. You should be 550 The format of the word list is used |spell-wordlist-format|. You should be
535 able to read it with ":mkspell" to generate one .spl file that includes all 551 able to read it with ":mkspell" to generate one .spl file that includes all
536 the words. 552 the words.
537 553
538 When all entries to 'spelllang' use the same regions or no regions at all then 554 When all entries to 'spelllang' use the same regions or no regions at all then
567 583
568 Additionally the following items are recognized: 584 Additionally the following items are recognized:
569 585
570 - Empty and blank lines are ignored. 586 - Empty and blank lines are ignored.
571 587
588 # comment ~
572 - Lines starting with a # are ignored (comment lines). 589 - Lines starting with a # are ignored (comment lines).
573 590
591 /encoding=utf-8 ~
574 - A line starting with "/encoding=", before any word, specifies the encoding 592 - A line starting with "/encoding=", before any word, specifies the encoding
575 of the file. After the second '=' comes an encoding name. This tells Vim 593 of the file. After the second '=' comes an encoding name. This tells Vim
576 to setup conversion from the specified encoding to 'encoding'. Thus you can 594 to setup conversion from the specified encoding to 'encoding'. Thus you can
577 use one word list for several target encodings. 595 use one word list for several target encodings.
578 596
597 /regions=usca ~
579 - A line starting with "/regions=" specifies the region names that are 598 - A line starting with "/regions=" specifies the region names that are
580 supported. Each region name must be two ASCII letters. The first one is 599 supported. Each region name must be two ASCII letters. The first one is
581 region 1. Thus "/regions=usca" has region 1 "us" and region 2 "ca". 600 region 1. Thus "/regions=usca" has region 1 "us" and region 2 "ca".
582 In an addition word list the region names should be equal to the main word 601 In an addition word list the region names should be equal to the main word
583 list! 602 list!
584 603
585 - Other lines starting with '/' are reserved for future use. The ones that 604 - Other lines starting with '/' are reserved for future use. The ones that
586 are not recognized are ignored (but you do get a warning message). 605 are not recognized are ignored. You do get a warning message, so that you
606 know something won't work.
587 607
588 - A "/" may follow the word with the following items: 608 - A "/" may follow the word with the following items:
589 = Case must match exactly. 609 = Case must match exactly.
590 ? Rare word. 610 ? Rare word.
591 ! Bad (wrong) word. 611 ! Bad (wrong) word.
606 Note that when "/=" is used the same word with all upper-case letters is not 626 Note that when "/=" is used the same word with all upper-case letters is not
607 accepted. This is different from a word with mixed case that is automatically 627 accepted. This is different from a word with mixed case that is automatically
608 marked as keep-case, those words may appear in all upper-case letters. 628 marked as keep-case, those words may appear in all upper-case letters.
609 629
610 630
611 FORMAT WITH AFFIX COMPRESSION 631 FORMAT WITH .AFF and .DIC FILES
612 632
613 There are two files: the basic word list and an affix file. The affixes are 633 There are two files: the basic word list and an affix file. The affix file
634 specifies settings for the language and can contain affixes. The affixes are
614 used to modify the basic words to get the full word list. This significantly 635 used to modify the basic words to get the full word list. This significantly
615 reduces the number of words, especially for a language like Polish. This is 636 reduces the number of words, especially for a language like Polish. This is
616 called affix compression. 637 called affix compression.
617 638
618 The basic word list and the affix file are combined and turned into a binary 639 The basic word list and the affix file are combined with the ":mkspell"
619 spell file. All the preprocessing has been done, thus this file loads fast. 640 command and results in a binary spell file. All the preprocessing has been
620 The binary spell file format is described in the source code (src/spell.c). 641 done, thus this file loads fast. The binary spell file format is described in
621 But only developers need to know about it. 642 the source code (src/spell.c). But only developers need to know about it.
622 643
623 The preprocessing also allows us to take the Myspell language files and modify 644 The preprocessing also allows us to take the Myspell language files and modify
624 them before the Vim word list is made. The tools for this can be found in the 645 them before the Vim word list is made. The tools for this can be found in the
625 "src/spell" directory. 646 "src/spell" directory.
626 647
628 (the spell checker of Mozilla and OpenOffice.org). A description can be found 649 (the spell checker of Mozilla and OpenOffice.org). A description can be found
629 here: 650 here:
630 http://lingucomponent.openoffice.org/affix.readme ~ 651 http://lingucomponent.openoffice.org/affix.readme ~
631 Note that affixes are case sensitive, this isn't obvious from the description. 652 Note that affixes are case sensitive, this isn't obvious from the description.
632 653
633 Vim does not use the TRY item, it is ignored. For making suggestions the
634 possible characters in the words are used.
635
636 Vim supports quite a few extras. They are described below |spell-affix-vim|. 654 Vim supports quite a few extras. They are described below |spell-affix-vim|.
637 Attempts have been made to keep this compatible with other spell checkers, so 655 Attempts have been made to keep this compatible with other spell checkers, so
638 that the same files can be used. 656 that the same files can often be used. One other project that offers more
657 than Myspell is Hunspell ( http://hunspell.sf.net ).
639 658
640 659
641 WORD LIST FORMAT *spell-dic-format* 660 WORD LIST FORMAT *spell-dic-format*
642 661
643 A very short example, with line numbers: 662 A short example, with line numbers:
644 663
645 1 1234 664 1 1234 ~
646 2 aan 665 2 aan ~
647 3 Als 666 3 Als ~
648 4 Etten-Leur 667 4 Etten-Leur ~
649 5 et al. 668 5 et al. ~
650 6 's-Gravenhage 669 6 's-Gravenhage ~
651 7 's-Gravenhaags 670 7 's-Gravenhaags ~
652 8 bedel/P 671 8 # word that differs between regions ~
653 9 kado/1 672 9 kado/1 ~
654 10 cadeau/2 673 10 cadeau/2 ~
655 11 TCP,IP 674 11 TCP,IP ~
675 12 /the S affix may add a 's' ~
676 13 bedel/S ~
656 677
657 The first line contains the number of words. Vim ignores it, but you do get 678 The first line contains the number of words. Vim ignores it, but you do get
658 an error message if it's not there. *E760* 679 an error message if it's not there. *E760*
659 680
660 What follows is one word per line. There should be no white space before or 681 What follows is one word per line. White space at the end of the line is
661 after the word. After the word there is an optional slash and flags. Most of 682 ignored, all other white space matters. The encoding is specified in the
662 these flags are letters that indicate the affixes that can be used with this 683 affix file |spell-SET|.
663 word. These are specified with SFX and PFX lines in the .aff file. See the 684
664 Myspell documentation. Vim allows using other flag types with the FLAG item 685 Comment lines start with '#' or '/'. See the example lines 8 and 12. Note
665 in the affix file |spell-FLAG|. 686 that putting a comment after a word is NOT allowed:
687
688 someword # comment that causes an error! ~
689
690 After the word there is an optional slash and flags. Most of these flags are
691 letters that indicate the affixes that can be used with this word. These are
692 specified with SFX and PFX lines in the .aff file, see |spell-SFX| and
693 |spell-PFX|. Vim allows using other flag types with the FLAG item in the
694 affix file |spell-FLAG|.
666 695
667 When the word only has lower-case letters it will also match with the word 696 When the word only has lower-case letters it will also match with the word
668 starting with an upper-case letter. 697 starting with an upper-case letter.
669 698
670 When the word includes an upper-case letter, this means the upper-case letter 699 When the word includes an upper-case letter, this means the upper-case letter
671 is required at this position. The same word with a lower-case letter at this 700 is required at this position. The same word with a lower-case letter at this
672 position will not match. When some of the other letters are upper-case it will 701 position will not match. When some of the other letters are upper-case it will
673 not match either. 702 not match either.
674 703
675 The word with all upper-case characters will always be OK. 704 The word with all upper-case characters will always be OK,
676 705
677 word list matches does not match ~ 706 word list matches does not match ~
678 als als Als ALS ALs AlS aLs aLS 707 als als Als ALS ALs AlS aLs aLS
679 Als Als ALS als ALs AlS aLs aLS 708 Als Als ALS als ALs AlS aLs aLS
680 ALS ALS als Als ALs AlS aLs aLS 709 ALS ALS als Als ALs AlS aLs aLS
681 AlS AlS ALS als Als ALs aLs aLS 710 AlS AlS ALS als Als ALs aLs aLS
682 711
683 The KEEPCASE affix ID can be used to specifically match a word with identical 712 The KEEPCASE affix ID can be used to specifically match a word with identical
684 case only, see below |spell-KEEPCASE|. 713 case only, see below |spell-KEEPCASE|.
685 714
686 Note in line 5 to 7 that non-word characters are used. You can include 715 Note: in line 5 to 7 non-word characters are used. You can include any
687 any character in a word. When checking the text a word still only matches 716 character in a word. When checking the text a word still only matches when it
688 when it appears with a non-word character before and after it. For Myspell a 717 appears with a non-word character before and after it. For Myspell a word
689 word starting with a non-word character probably won't work. 718 starting with a non-word character probably won't work.
690 719
691 In line 12 the word "TCP/IP" is defined. Since the slash has a special 720 In line 12 the word "TCP/IP" is defined. Since the slash has a special
692 meaning the comma is used instead. This is defined with the SLASH item in the 721 meaning the comma is used instead. This is defined with the SLASH item in the
693 affix file, see |spell-SLASH|. Note that without this SLASH item the 722 affix file, see |spell-SLASH|. Note that without this SLASH item the word
694 word will be "TCP,IP". 723 will be "TCP,IP".
695 724
696 *spell-affix-vim* 725
697 A flag that Vim adds and is not in Myspell is the flag defined with KEEPCASE 726 AFFIX FILE FORMAT *spell-aff-format* *spell-affix-vim*
698 in the affix file. This has the meaning that case matters. This can be used 727
699 if the word does not have the first letter in upper case at the start of a 728 *spell-affix-comment*
700 sentence. Example (assuming that = was used for KEEPCASE): 729 Comment lines in the .aff file start with a '#':
701 730
702 word list matches does not match ~ 731 # comment line ~
703 's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS 732
704 's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens 733 With some items it's also possible to put a comment after it, but this isn't
705 734 supported in general.
706 The flag can also be used to avoid that the word matches when it is in all 735
707 upper-case letters. 736
708 737 ENCODING *spell-SET*
738
739 The affix file can be in any encoding that is supported by "iconv". However,
740 in some cases the current locale should also be set properly at the time
741 |:mkspell| is invoked. Adding FOL/LOW/UPP lines removes this requirement
742 |spell-FOL|.
743
744 The encoding should be specified before anything where the encoding matters.
745 The encoding applies both to the affix file and the dictionary file. It is
746 done with a SET line:
747
748 SET utf-8 ~
749
750 The encoding can be different from the value of the 'encoding' option at the
751 time ":mkspell" is used. Vim will then convert everything to 'encoding' and
752 generate a spell file for 'encoding'. If some of the used characters to not
753 fit in 'encoding' you will get an error message.
709 *spell-affix-mbyte* 754 *spell-affix-mbyte*
710 The basic word list is normally in an 8-bit encoding, which is mentioned in 755 When using a multi-byte encoding it's possible to use more different affix
711 the affix file. The affix file must always be in the same encoding as the 756 flags. But Myspell doesn't support that, thus you may not want to use it
712 word list. This is compatible with Myspell. For Vim the encoding may also be 757 anyway. For compatibility use an 8-bit encoding.
713 something else, any encoding that "iconv" supports. The "SET" line must
714 specify the name of the encoding. When using a multi-byte encoding it's
715 possible to use more different affixes (but Myspell doesn't support that, thus
716 you may not want to use it anyway).
717 758
718 759
719 CHARACTER TABLES 760 CHARACTER TABLES
720 *spell-affix-chars* 761 *spell-affix-chars*
721 When using an 8-bit encoding the affix file should define what characters are 762 When using an 8-bit encoding the affix file should define what characters are
722 word characters (as specified with ENC). This is because the system where 763 word characters. This is because the system where ":mkspell" is used may not
723 ":mkspell" is used may not support a locale with this encoding and isalpha() 764 support a locale with this encoding and isalpha() won't work. For example
724 won't work. For example when using "cp1250" on Unix. 765 when using "cp1250" on Unix.
725
726 *E761* *E762* *spell-FOL* 766 *E761* *E762* *spell-FOL*
727 *spell-LOW* *spell-UPP* 767 *spell-LOW* *spell-UPP*
728 Three lines in the affix file are needed. Simplistic example: 768 Three lines in the affix file are needed. Simplistic example:
729 769
730 FOL áëñ ~ 770 FOL áëñ ~
772 character, but when it appears in between word characters it must be part of 812 character, but when it appears in between word characters it must be part of
773 the word. This is needed to detect a spelling error such as they'are. That 813 the word. This is needed to detect a spelling error such as they'are. That
774 should be they're, but since "they" and "are" are words themselves that would 814 should be they're, but since "they" and "are" are words themselves that would
775 go unnoticed. 815 go unnoticed.
776 816
777 These characters are defined with MIDWORD in the .aff file: 817 These characters are defined with MIDWORD in the .aff file. Example:
778 818
779 MIDWORD '- ~ 819 MIDWORD '- ~
780 820
781 821
782 FLAG TYPES *spell-FLAG* 822 FLAG TYPES *spell-FLAG*
806 *spell-PFX* *spell-SFX* 846 *spell-PFX* *spell-SFX*
807 The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell 847 The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell
808 documentation or the Aspell manual: 848 documentation or the Aspell manual:
809 http://aspell.net/man-html/Affix-Compression.html). 849 http://aspell.net/man-html/Affix-Compression.html).
810 850
811 Note that Myspell ignores any extra text after the relevant info. Vim 851 Summary:
812 requires this text to start with a "#" so that mistakes don't go unnoticed. 852 SFX L Y 2 ~
813 Example: 853 SFX L 0 re [^x] ~
854 SFX L 0 ro x ~
855
856 The first line is a header and has four fields:
857 SFX {flag} {combine} {count}
858
859 {flag} The name used for the suffix. Mostly it's a single letter,
860 but other characters can be used, see |spell-FLAG|.
861
862 {combine} Can be 'Y' or 'N'. When 'Y' then the word plus suffix can
863 also have a prefix. When 'N' then a prefix is not allowed.
864
865 {count} The number of lines following. If this is wrong you will get
866 an error message.
867
868 For PFX the fields are exactly the same.
869
870 The basic format for the following lines is:
871 SFX {flag} {strip} {add} {condition}
872
873 {flag} Must be the same as the {flag} used in the first line.
874
875 {strip} Characters removed from the basic word. There is no check if
876 the characters are actually there, only the length is used (in
877 bytes). This better match the {condition}, otherwise strange
878 things may happen. If the {strip} length is equal to or
879 longer than the basic word the suffix won't be used.
880 When {strip} is 0 (zero) then nothing is stripped.
881
882 {add} Characters added to the basic word, after removing {strip}.
883
884 {condition} A simplistic pattern. Only when this matches with a basic
885 word will the suffix be used for that word. This is normally
886 for using one suffix letter with different {add} and {strip}
887 fields for words with different endings.
888 When {condition} is a . (dot) there is no condition.
889 The pattern may contain:
890 - Literal characters.
891 - A set of characters in []. [abc] matches a, b and c.
892 A dash is allowed for a range [a-c], but this is
893 Vim-specific.
894 - A set of characters that starts with a ^, meaning the
895 complement of the specified characters. [^abc] matches any
896 character but a, b and c.
897
898 For PFX the fields are the same, but the {strip}, {add} and {condition} apply
899 to the start of the word.
900
901 Note: Myspell ignores any extra text after the relevant info. Vim requires
902 this text to start with a "#" so that mistakes don't go unnoticed. Example:
814 903
815 SFX F 0 in [^i]n # Spion > Spionin ~ 904 SFX F 0 in [^i]n # Spion > Spionin ~
816 SFX F 0 nen in # Bauerin > Bauerinnen ~ 905 SFX F 0 nen in # Bauerin > Bauerinnen ~
817 906
818 Apparently Myspell allows an affix name to appear more than once. Since this 907 Apparently Myspell allows an affix name to appear more than once. Since this
824 913
825 SFX a Y 2 S ~ 914 SFX a Y 2 S ~
826 SFX a 0 en . ~ 915 SFX a 0 en . ~
827 SFX a 0 on . ~ 916 SFX a 0 on . ~
828 917
918
919 AFFIX FLAGS *spell-affix-flags*
920
921 This is a feature that comes from Hunspell: The affix may specify flags. This
922 works similar to flags specified on a basic word. The flags apply to the
923 basic word plus the affix. Example:
924
925 SFX S Y 1 ~
926 SFX S 0 s . ~
927
928 SFX A Y 1 ~
929 SFX A 0 able/S . ~
930
931 When the dictionary file contains "drink/AS" then these words are possible:
932
933 drink
934 drinks uses S suffix
935 drinkable uses A suffix
936 drinkables uses A suffix and then S suffix
937
938 Generally the flags of the suffix are added to the flags of the basic word,
939 both are used for the word plus suffix. But the flags of the basic word are
940 only used once for affixes, except that both one prefix and one suffix can be
941 used when both support combining.
942
943 Specifically, the affix flags can be used for:
944 - Affixes on affixes, as in the example above.
945 - Making the word with the affix rare, by using the |spell-RARE| flag.
946 - Exclude the word with the affix from compounding, by using the
947 |spell-COMPOUNDFORBIDFLAG| flag.
948
949 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
950 OLD STUFF
829 *spell-affix-rare* 951 *spell-affix-rare*
830 An extra item for Vim is the "rare" flag. It must come after the other 952 An extra item for Vim is the "rare" flag. It must come after the other
831 fields, before a comment. When used then all words that use the affix will be 953 fields, before a comment. When used then all words that use the affix will be
832 marked as rare words. Example: 954 marked as rare words. Examples:
833 955
834 PFX F 0 nene . rare ~ 956 PFX F 0 nene . rare ~
835 SFX F 0 oin n rare # hardly ever used ~ 957 SFX F 0 oin n rare # hardly ever used ~
836 958
837 However, if the word also appears as a good word in another way it won't be 959 However, if the word also appears as a good word in another way (e.g., in
838 marked as rare. 960 another region) it won't be marked as rare.
839 961
840 *spell-affix-nocomp* 962 *spell-affix-nocomp*
841 Another extra item for Vim is the "nocomp" flag. It must come after the other 963 Another extra item for Vim is the "nocomp" flag. It must come after the other
842 fields, before a comment. It can be either before or after "rare". When 964 fields, before a comment. It can be either before or after "rare". When
843 present then all words that use the affix will not be part of a compound word. 965 present then all words that use the affix will not be part of a compound word.
850 dictionary: 972 dictionary:
851 word/c ~ 973 word/c ~
852 util/ac ~ 974 util/ac ~
853 975
854 This allows for "wordutil" and "wordutils" but not "wordutilize". 976 This allows for "wordutil" and "wordutils" but not "wordutilize".
977 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
855 978
856 *spell-PFXPOSTPONE* 979 *spell-PFXPOSTPONE*
857 When an affix file has very many prefixes that apply to many words it's not 980 When an affix file has very many prefixes that apply to many words it's not
858 possible to build the whole word list in memory. This applies to Hebrew (a 981 possible to build the whole word list in memory. This applies to Hebrew (a
859 list with all words is over a Gbyte). In that case applying prefixes must be 982 list with all words is over a Gbyte). In that case applying prefixes must be
889 In the affix file a KEEPCASE line can be used to define the affix name used 1012 In the affix file a KEEPCASE line can be used to define the affix name used
890 for keep-case words. Example: 1013 for keep-case words. Example:
891 1014
892 KEEPCASE = ~ 1015 KEEPCASE = ~
893 1016
894 See above for an example |spell-affix-vim|. 1017 This flag is not supported by Myspell. It has the meaning that case matters.
1018 This can be used if the word does not have the first letter in upper case at
1019 the start of a sentence. Example:
1020
1021 word list matches does not match ~
1022 's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS
1023 's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens
1024
1025 The flag can also be used to avoid that the word matches when it is in all
1026 upper-case letters.
895 1027
896 1028
897 RARE WORDS *spell-RARE* 1029 RARE WORDS *spell-RARE*
898 1030
899 In the affix file a RARE line can be used to define the affix name used for 1031 In the affix file a RARE line can be used to define the affix name used for
920 the the/! ~ 1052 the the/! ~
921 1053
922 Once a word has been marked as bad it won't be undone by encountering the same 1054 Once a word has been marked as bad it won't be undone by encountering the same
923 word as good. 1055 word as good.
924 1056
1057 The flag also applies to the word with affixes, thus this can be used to mark
1058 a whole bunch of related words as bad.
1059
925 *spell-NEEDAFFIX* 1060 *spell-NEEDAFFIX*
926 The NEEDAFFIX flag is used to require that a word is used with an affix. The 1061 The NEEDAFFIX flag is used to require that a word is used with an affix. The
927 word itself is not a good word. Example: 1062 word itself is not a good word (unless there is an empty affix). Example:
928 1063
929 NEEDAFFIX + ~ 1064 NEEDAFFIX + ~
930
931 *spell-NEEDCOMPOUND*
932 The NEEDCOMPOUND flag is used to require that a word is used as part of a
933 compound word The word itself is not a good word. Example:
934
935 NEEDCOMPOUND & ~
936 1065
937 1066
938 COMPOUND WORDS *spell-compound* 1067 COMPOUND WORDS *spell-compound*
939 1068
940 A compound word is a longer word made by concatenating words that appear in 1069 A compound word is a longer word made by concatenating words that appear in
942 used. This character is put in the list of affixes after the word. We will 1071 used. This character is put in the list of affixes after the word. We will
943 call this character a flag here. Obviously these flags must be different from 1072 call this character a flag here. Obviously these flags must be different from
944 any affix IDs used. 1073 any affix IDs used.
945 1074
946 *spell-COMPOUNDFLAG* 1075 *spell-COMPOUNDFLAG*
947 The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. 1076 The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. All
948 All words with this flag combine in any order. This means there is no control 1077 words with this flag combine in any order. This means there is no control
949 over which word comes first. Example: 1078 over which word comes first. Example:
950 COMPOUNDFLAG c ~ 1079 COMPOUNDFLAG c ~
951 1080
952 *spell-COMPOUNDFLAGS* 1081 *spell-COMPOUNDFLAGS*
953 A more advanced method to specify how compound words can be formed uses 1082 A more advanced method to specify how compound words can be formed uses
1004 end/e ~ 1133 end/e ~
1005 -/xd ~ 1134 -/xd ~
1006 1135
1007 This allows for the word "start-end", but not "startend". 1136 This allows for the word "start-end", but not "startend".
1008 1137
1138 *spell-NEEDCOMPOUND*
1139 The NEEDCOMPOUND flag is used to require that a word is used as part of a
1140 compound word. The word itself is not a good word. Example:
1141
1142 NEEDCOMPOUND & ~
1143
1009 *spell-COMPOUNDMIN* 1144 *spell-COMPOUNDMIN*
1010 The minimal character length of a word used for compounding is specified with 1145 The minimal character length of a word used for compounding is specified with
1011 COMPOUNDMIN. Example: 1146 COMPOUNDMIN. Example:
1012 COMPOUNDMIN 5 ~ 1147 COMPOUNDMIN 5 ~
1013 1148
1034 is no limit on the number of syllables. 1169 is no limit on the number of syllables.
1035 1170
1036 If both COMPOUNDMAX and COMPOUNDSYLMAX are defined, a compound word is 1171 If both COMPOUNDMAX and COMPOUNDSYLMAX are defined, a compound word is
1037 accepted if it fits one of the criteria, thus is either made from up to 1172 accepted if it fits one of the criteria, thus is either made from up to
1038 COMPOUNDMAX words or contains up to COMPOUNDSYLMAX syllables. 1173 COMPOUNDMAX words or contains up to COMPOUNDSYLMAX syllables.
1174
1175 *spell-COMPOUNDFORBIDFLAG*
1176 The COMPOUNDFORBIDFLAG specifies a flag that can be used on an affix. It
1177 means that the word plus affix cannot be used in a compound word.
1178 NOT IMPLEMENTED YET.
1179
1180 *spell-COMPOUNDPERMITFLAG*
1181 The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It
1182 means that the word plus affix can also be used in a compound word in a way
1183 where the affix ends up halfway the word.
1184 NOT IMPLEMENTED YET.
1039 1185
1040 *spell-SYLLABLE* 1186 *spell-SYLLABLE*
1041 The SYLLABLE item defines characters or character sequences that are used to 1187 The SYLLABLE item defines characters or character sequences that are used to
1042 count the number of syllables in a word. Example: 1188 count the number of syllables in a word. Example:
1043 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui ~ 1189 SYLLABLE aáeéiíoóöõuúüûy/aa/au/ea/ee/ei/ie/oa/oe/oo/ou/uu/ui ~
1103 > CMP {flag} . 0 0 . . 1249 > CMP {flag} . 0 0 . .
1104 > 1250 >
1105 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 1251 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1106 1252
1107 1253
1254 *spell-COMMON*
1255 Common words can be specified with the COMMON item. This will give better
1256 suggestions when editing a short file. Example:
1257
1258 COMMON the of to and a in is it you that he was for on are ~
1259
1260 The words must be separated by white space, up to 25 per line.
1261 When multiple regions are specified in a ":mkspell" command the common words
1262 for all regions are combined and used for all regions.
1263
1264 *spell-NOSPLITSUGS*
1265 This item indicates that suggestions for splitting a word will not appear:
1266
1267 NOSPLITSUGS ~
1268
1269 *spell-NOSUGGEST*
1270 The flag specified with NOSUGGEST can be used for words that will not be
1271 suggested. Can be used for obscene words.
1272
1273 NOSUGGEST % ~
1274
1275 NOT IMPLEMENTED YET.
1276
1277
1108 REPLACEMENTS *spell-REP* 1278 REPLACEMENTS *spell-REP*
1109 1279
1110 In the affix file REP items can be used to define common mistakes. This is 1280 In the affix file REP items can be used to define common mistakes. This is
1111 used to make spelling suggestions. The items define the "from" text and the 1281 used to make spelling suggestions. The items define the "from" text and the
1112 "to" replacement. Example: 1282 "to" replacement. Example:
1116 REP ph f ~ 1286 REP ph f ~
1117 REP k ch ~ 1287 REP k ch ~
1118 REP ch k ~ 1288 REP ch k ~
1119 1289
1120 The first line specifies the number of REP lines following. Vim ignores the 1290 The first line specifies the number of REP lines following. Vim ignores the
1121 number, but it must be there. 1291 number, but it must be there (for compatibility with Myspell).
1122 1292
1123 Don't include simple one-character replacements or swaps. Vim will try these 1293 Don't include simple one-character replacements or swaps. Vim will try these
1124 anyway. You can include whole words if you want to, but you might want to use 1294 anyway. You can include whole words if you want to, but you might want to use
1125 the "file:" item in 'spellsuggest' instead. 1295 the "file:" item in 'spellsuggest' instead.
1126 1296
1142 The first line specifies the number of MAP lines following. Vim ignores the 1312 The first line specifies the number of MAP lines following. Vim ignores the
1143 number, but the line must be there. 1313 number, but the line must be there.
1144 1314
1145 Each letter must appear in only one of the MAP items. It's a bit more 1315 Each letter must appear in only one of the MAP items. It's a bit more
1146 efficient if the first letter is ASCII or at least one without accents. 1316 efficient if the first letter is ASCII or at least one without accents.
1317
1318
1319 .SUG FILE *spell-NOSUGFILE*
1320
1321 When soundfolding is specified in the affix file then ":mkspell" will normally
1322 p ~ ~roduce a .sug file next to the .spl file. This used to find suggestions by
1323 their sound-a-like form quickly. At the cost of a lot of memory.
1324
1325 To avoid producing a .sug file use this item in the affix file:
1326
1327 NOSUGFILE ~
1147 1328
1148 1329
1149 SOUND-A-LIKE *spell-SAL* 1330 SOUND-A-LIKE *spell-SAL*
1150 1331
1151 In the affix file SAL items can be used to define the sounds-a-like mechanism 1332 In the affix file SAL items can be used to define the sounds-a-like mechanism
1195 1376
1196 You can use the |soundfold()| function to try out the results. Or set the 1377 You can use the |soundfold()| function to try out the results. Or set the
1197 'verbose' option to see the score in the output of the |z=| command. 1378 'verbose' option to see the score in the output of the |z=| command.
1198 1379
1199 1380
1381 UNSUPPORTED ITEMS *spell-affix-not-supported*
1382
1383 These items appear in the affix file of other spell checkers. In Vim they are
1384 ignored, not supported or defined in another way.
1385
1386 ACCENT (Hunspell) *spell-ACCENT*
1387 Use MAP instead. |spell-MAP|
1388
1389 CHECKCOMPOUNDCASE (Hunspell) *spell-CHECKCOMPOUNDCASE*
1390 Disallow uppercase letters at compound word boundaries.
1391 Not supported.
1392
1393 CHECKCOMPOUNDDUP (Hunspell) *spell-CHECKCOMPOUNDDUP*
1394 Disallow using the same word twice in a compound. Not
1395 supported.
1396
1397 CHECKCOMPOUNDREP (Hunspell) *spell-CHECKCOMPOUNDREP*
1398 Something about using REP items and compound words. Not
1399 supported.
1400
1401 CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE*
1402 Forbid three identical characters when compounding. Not
1403 supported.
1404
1405 CHECKCOMPOUNDPATTERN (Hunspell) *spell-CHECKCOMPOUNDPATTERN*
1406 Forbid compounding when patterns match. Not supported.
1407
1408 CIRCUMFIX (Hunspell) *spell-CIRCUMFIX*
1409 This means a prefix and suffix must be added at the same time.
1410 Instead only specify the suffix, and give the that suffix two
1411 flags: The required prefix and the NEEDAFFIX flag.
1412 |spell-NEEDAFFIX|
1413
1414 COMPLEXPREFIXES (Hunspell) *spell-COMPLEXPREFIXES*
1415 Enables using two prefixes. Not supported.
1416
1417 COMPOUNDBEGIN (Hunspell) *spell-COMPOUNDBEGIN*
1418 Use COMPOUNDFLAGS instead. |spell-COMPOUNDFLAGS|
1419
1420 COMPOUNDEND (Hunspell) *spell-COMPOUNDEND*
1421 Use COMPOUNDFLAGS instead. |spell-COMPOUNDFLAGS|
1422
1423 COMPOUNDMIDDLE (Hunspell) *spell-COMPOUNDMIDDLE*
1424 Use COMPOUNDFLAGS instead. |spell-COMPOUNDFLAGS|
1425
1426 COMPOUNDROOT (Hunspell) *spell-COMPOUNDROOT*
1427 Flag for words in the dictionary that are already a compound.
1428 Vim doesn't use it.
1429
1430 COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
1431 Use SYLLABLE and COMPOUNDSYLMAX instead. |spell-SYLLABLE|
1432 |spell-COMPOUNDSYLMAX|
1433
1434 COMPOUNDWORDMAX (Hunspell) *spell-COMPOUNDWORDMAX*
1435 Use COMPOUNDMAX instead. |spell-COMPOUNDMAX|
1436
1437 FORBIDDENWORD (Hunspell) *spell-FORBIDDENWORD*
1438 Use BAD instead. |spell-BAD|
1439
1440 HOME (Hunspell) *spell-HOME*
1441 Specifies the website for the language. Not supported.
1442
1443 LANG (Hunspell) *spell-LANG*
1444 This specifies language-specific behavior. This actually
1445 moves part of the language knowledge into the program,
1446 therefore Vim does not support it. Each language property
1447 must be specified separately.
1448
1449 LEMMA_PRESENT (Hunspell) *spell-LEMMA_PRESENT*
1450 Only needed for mprphological analysis.
1451
1452 MAXNGRAMSUGS (Hunspell) *spell-MAXNGRAMSUGS*
1453 Not supported.
1454
1455 NAME (Hunspell) *spell-NAME*
1456 Specifies the name of the language. Not supported.
1457
1458 ONLYINCOMPOUND (Hunspell) *spell-ONLYINCOMPOUND*
1459 Use NEEDCOMPOUND instead. |spell-NEEDCOMPOUND|
1460
1461 PSEUDOROOT (Hunspell) *spell-PSEUDOROOT*
1462 Use NEEDAFFIX instead. |spell-NEEDAFFIX|
1463
1464 SUGSWITHDOTS (Hunspell) *spell-SUGSWITHDOTS*
1465 Adds dots to suggestions. Vim doesn't need this.
1466
1467 SYLLABLENUM (Hunspell) *spell-SYLLABLENUM*
1468 Not supported.
1469
1470 TRY (Myspell, Hunspell, others) *spell-TRY*
1471 Vim does not use the TRY item, it is ignored. For making
1472 suggestions the actual characters in the words are used.
1473
1474 VERSION (Hunspell) *spell-VERSION*
1475 Specifies the version for the language. Not supported.
1476
1477 WORDCHARS (Hunspell) *spell-WORDCHARS*
1478 Used to recognize words. Vim doesn't need it, because there
1479 is no need to separate words before checking them (using a
1480 trie instead of a hashtable).
1481
1200 vim:tw=78:sw=4:ts=8:ft=help:norl: 1482 vim:tw=78:sw=4:ts=8:ft=help:norl: