The casefix project seeks to develop a shared library (a library that can be statically linked if desired) of casing tools for use in text editors, word processors, database managers and other applications where text is edited, so as to provide the tools' functionality and minimize casing code on any given system.

    The primary part of the casefix project is a small c library of case editing functions, the heart of which is 7 streaming case editors. Also, there are 3 functions that interface char arrays and strings to the streaming editors. So the library can modify the casing of any character, character block (word), any character string, character array, or any character stream. Currently, libcasefix only handles 7 or 8 bit character sets with some support for UTF-8. With that in mind casefix does support a number of character sets for internationalization. Also, there is a casefix command that implements the functionality of the casefix library for use at the command line.

    libcasefix is ANSI C / ISO C90 compatible but also provides for even older C compilers. libcasefix relies only on the standard C library and uses no extensions to the standard C library. In other words, libcasefix is portable.

    The modes that the casefix command and library  has are::

        lowerall  - lower cases all alphabetic characters. Apropos to regular words which do not begin sentences nor are proper nouns, nor the pronoun "I", in preparation of running another casefix function / routine over same set of words.

        nominate  - cases the words in the case of proper nouns, that is the first alphabetic character of every word, lower casing all other alphabetic characters. Apropos to names of people and other proper nouns, words that begin sentences, first and significant words in titles, and the pronoun "I". nominate is more preferable than custom mode equivalent; it doesn't need to check the casing template every character.

        capall  - capitalizes all alphabetic characters apropos to important notices, Apropos uses: signage, names of regulatable people and entities.

        switchcaseall  - changes the case of all alphabetic characters regardless of original casing. Apropos to differentiating two things with same name, ie. file names, or correcting text where the caps lock button was incorrectly on the whole time of creation.

        wackify  - changes the case of alphabetic characters in a pseudo-random way. Apropos to wackiness.

        custom  - cases words according to a user supplied casing template. Apropos to BiCapitalization, camelCasing character blocks (words) where non-last subword lengths are the same, as well as other custom uses.

        prepsentences  - cases sentences in the fashion of prose sentences, that is the first alphanumeric character of the first word is capitalized if it is an alphabetic character and lower cases all other alphabetic characters until it reaches a sentence delimiter. The sentence delimiters are the "." - period, the "?" - question mark, and the "!" - exclamation point. Be advised that prepsentences does not necessarily case sentences properly given the vagaries and the various styles of written language. It does not have grammar parsing capability beyond that described here nor does it differentiate proper nouns from other words. In other words, it runs over proper nouns which are not the first word of a sentence. It still may be useful in that it may be easier to prepsentence the text and then correct the sentences, perhaps using an editor that incorporates a libcasefix tool, rather than making case correction some other way.

    Also, there is a casefic Programmer's Reference Guide included in the development kit.

To get casefix/libcasefix source code and  Programmer's Reference Guide in a tar.gz file (45.2  Kb), please click the download link

download

or goto:

http://sourceforge.net/projects/casefix/

Contact

casefixproject@gmail.com