# Alphabetic Case Transformations

Yate supports a wide variety of alphabetic case transformations. These transformations are available in the Multi Field Editor, via actions, via the file/folder rename functionality and from the Yate Transformations text field menu item.

The following basic operations are available:

> No Change
>   No case transformations occur. However, the exception and replacement functionality described below is still applied.
> lower
>   All alphabetic characters are converted to lower case.
> UPPER
>   All alphabetic characters are converted to upper case.
> Capitalize
>   The first character of every word is converted to upper case. All other characters are converted to lower case.
> Capitalize First
>   The first character of the first word is converted to upper case. All other characters are converted to lower case.
> Title Case
>   With exceptions for a list of words such as 'and', 'a', etc., the first character of every word is converted to upper case. Words containing upper case characters in any position other than the first letter are not modified. The first and last word will always start with a capital letter. Note that this transformation uses the Title Case Exception set to determine the list of words to not be converted to upper case. You can configure the algorithm via Preferences - General - Title Case.
> lower-Title Case
>   This is a hybrid mode used to force processing of all words, even if they contain upper case characters. This is achieved by converting the text to lower case prior to applying the title case algorithm. You can configure the algorithm via Preferences - General - Title Case
> Sentence Case
>   The first character in every sentence is capitalized.

Every case transformation can optionally do Name Exceptions, General Exceptions, Field Exceptions, Replacements and Roman Numeral capitalization.

Name exceptions are used to match entire words or the beginning of words to a list of items stored in a list. If a match is found, the word is replaced by the item from the list. This can be used in conjunction with Capitalize First to enable Sentence Case transformations. Sentence Case capitalizes only the first word in a sentence and those words which are proper names. If your name exception list contained 'Canada', every occurrence of 'Canada' regardless of case and the basic operation, would be replaced with 'Canada'. You can also specify wildcard items in the list. Wildcard items must contain at least three characters. There are two variants:

> Name exception ends with an *
>   If a word begins with the text before the * character, it will use the text before the * and all following characters will be in lower case. For example MACDONALD matched against a name exception of MacD* will be converted to MacDonald.
> Name exception ends with a ?
>   If a word begins with the text before the ? character, it will use the text before the ?. The next character wil be capitalized and subsequent characters will be in lower case. For example MCVIE matched against a name exception of Mc? will be converted to McVie.

General exceptions match words against items in a list and if matched, represent the text according to a specified operation. The operations are No Change, Lower, Upper, Capitalize and Force Exception. No Change means that on a match the word is not modified, regardless of the basic operation. Lower, Upper and Capitalize perform the specified modification regardless of the basic operation. Force Exception forces the capitalization as specified. Every item in an exception list can also be marked as No Change on Exact Match. This means that the word is not modified if it exactly matches the item in the list. With a list item of 'Yate', Capitalize and Ignore on exact match, 'yate' will be changed to 'YATE' but 'Yate' will not be modified.

Field exceptions do not operate on words but on an entire text string. With field exceptions a Yate field is used as an exception. For example, if you specified the Artist field as an exception, the first occurrence of the artist name in the text will be replaced by the exact match of the name as specified in the Artist field.

Replacements do not operate on words but on an entire text string. Every item in a replacement list specifies a from and to pattern. Any match of the from pattern is replaced by the to pattern.

Roman Numeral capitalization searches for all valid Roman Numeral sequences and ensures that they are represented as upper case characters. This will correct the conversion to lower case caused by some of the previous transformations. Note that the word mix can be excluded via a Preferences - General setting.

The sets used with exceptions and replacements are as follows:

Name Exceptions
  The exception set with the N status code will be used.
General exceptions
  If renaming, the exception set with the R status will be used. If not renaming, the set with the C status will be used. If the exception set cannot be located the exception set which has the ✓️ status code will be used.
Replacements
  If renaming, the replacement set with the R status will be used. If not renaming, the set with the C status will be used. If the replacement set cannot be located the replacement set which has the ✓️ status code will be used.

The sequence of events is as follows:

- Attempt to perform Name exceptions, if enabled and an appropriate exception set was found
- Attempt to perform General exceptions, if enabled and an appropriate exception set was found.
- If no matches of either exception type was made, transform the word according to the rules of the basic operation.
- Perform the Field exception, if there is one.
- Perform Replacements, if enabled and an appropriate replacement set was found
- Perform Roman Numeral Capitalization, if enabled.