C# Class SILUBS.ScriptureChecks.QTokenProcessor

Class dedicated to the processing of quotation-related tokens
Mostrar archivo Open project: sillsdev/FieldWorks Class Usage Examples

Private Methods

Method Description
AddTextToParaStartTokens ( ITextToken tok ) : void

Finds paragraph-start tokens (REVIEW: I think there can only be one) in the list of quotation-related substring tokens that are in the given token replace them (if possible) with new paragraph-start tokens that include the first word or character of the token so that there will be some text to highlight in the view when this error is selected in the list being displayed

CheckForRemaining ( OpenQuotes current ) : void

This function is called after all the quotation related tokens have been processed. It generates errors for quotes that are still open at this point.

CheckQuote ( QuotationMarkToken qmtok, OpenQuotes openQuotes ) : void

Given the information of the currently open quotation marks, process the next encountered quotation mark, updating the information and generating errors where appropriate.

FinalizeResult ( ) : void

Goes through the list of quotation related tokens and generates errors for missing continuers and quotations.

GenerateTraceMsg ( QToken qmTok, string message ) : void

If verbose quotes are activated, outputs (the text token substring of) the given quotation related token, attaching the given trace message to it.

GetContinuersNeeded ( string styleName, string prevStyleName, int level ) : List

Processes paragraph-start tokens encountered and returns a list of the continuers that should follow the marker, based on the marker, the currently open quotes, and the quotation categorizer settings.

GetExpectedContinuerLevel ( string continuer, int currentLevel ) : int

Gets the expected continuer level.

Localize ( string strToLocalize ) : string

Localizes the specified string.

MatchContinuers ( int qrToksIndex, List continuersNeeded, int currentLevel ) : bool

This function is called each time a marker is encountered that should be followed by one or more continuers. Returns true if the expected continuers are present, false otherwise.

Output ( TextTokenSubstring tts ) : void

Adds the text token substring of a quotation related token to the list of results. At this point the message of the substring is either an error or trace message.

ProcessToken ( ITextToken tok, SILUBS.ScriptureChecks.VerseTextToken verseTok ) : void

If the token starts a typographic paragraph, store it as a paragraph-start token and highlight (shows up on user interface) its text. Otherwise, if the token is a quotation mark (either opening or closing, as defined by the quotation categorizer), store it as a quotation mark token.

QTokenProcessor ( IChecksDataSource dataSource, CharacterCategorizer charCategorizer, QuotationMarkCategorizer qmCategorizer, string desiredKey, List results ) : System

Initializes a new instance of the QuotationRelatedTokensProcessor class.

ReportError ( QToken qrTok, string message ) : void

Outputs (the text token substring of) the given quotation related token, attaching the given error message to it.