Class WordTaggerBase
Base tagger class for classification of words.
Inherited Members
Namespace: Telerik.Windows.Controls.SyntaxEditor.Tagging.Taggers
Assembly: Telerik.Windows.Controls.SyntaxEditor.dll
Syntax
public abstract class WordTaggerBase : TaggerBase<ClassificationTag>, ITagger<ClassificationTag>
Constructors
WordTaggerBase(RadSyntaxEditor)
Initializes a new instance of the WordTaggerBase class.
Declaration
protected WordTaggerBase(RadSyntaxEditor editor)
Parameters
RadSyntaxEditor
editor
The editor. |
Properties
EnableMultilineTags
Gets or sets a value indicating whether multiline tags are collected by this tagger instance. The method RebuildMultilineTags() process all document and collects Multiline tags in the MultilineTags property.
Declaration
public bool EnableMultilineTags { get; set; }
Property Value
System.Boolean
|
MultilineTags
The list of multiline ClassificationTags wrapped in TagSpans.
Declaration
protected IList<TagSpan<ClassificationTag>> MultilineTags { get; }
Property Value
System.Collections.Generic.IList<TagSpan<ClassificationTag>>
|
StringMatchingRegex
Gets or sets the regex pattern used to match strings in the documents which this tagger recognizes.
Declaration
protected virtual string StringMatchingRegex { get; set; }
Property Value
System.String
|
Methods
AddWord(String, ClassificationType)
Adds a new word-type pair in the dictionary.
Declaration
public void AddWord(string word, ClassificationType classificationType)
Parameters
System.String
word
|
ClassificationType
classificationType
|
GetCharType(Char)
Defines the different char types which is the essence of splitting words. A word is considered sequence of equally typed chars. 1 - whitespace, 2 - punctuation or symbol, 0 - letters and all other characters.
Declaration
protected virtual int GetCharType(char character)
Parameters
System.Char
character
|
Returns
System.Int32
|
GetTags(NormalizedSnapshotSpanCollection)
Gets the tags.
Declaration
public override IEnumerable<TagSpan<ClassificationTag>> GetTags(NormalizedSnapshotSpanCollection spans)
Parameters
NormalizedSnapshotSpanCollection
spans
|
Returns
System.Collections.Generic.IEnumerable<TagSpan<ClassificationTag>>
|
Overrides
GetWordsToClassificationTypes()
Gets the words to classification types.
Declaration
protected abstract Dictionary<string, ClassificationType> GetWordsToClassificationTypes()
Returns
System.Collections.Generic.Dictionary<System.String, ClassificationType>
Dictionary<System.String, ClassificationType>. |
InvalidateMultilineTags()
Clears all multiline tags and rebuilds them.
Declaration
protected virtual void InvalidateMultilineTags()
OnWordSplit(Int32, String)
Called when a word is split during processing of a line string.
Declaration
protected virtual void OnWordSplit(int wordCharType, string word)
Parameters
System.Int32
wordCharType
|
System.String
word
|
RebuildMultilineTags()
Rebuilds the MultilineTags collection.
Declaration
protected virtual void RebuildMultilineTags()
SplitIntoWords(String)
Splits the given string into collection of words.
Declaration
protected virtual IList<string> SplitIntoWords(string value)
Parameters
System.String
value
The given string to split. |
Returns
System.Collections.Generic.IList<System.String>
List of the words. |
TryGetClassificationType(String, out ClassificationType)
Tries to get the classification type for the given string word.
Declaration
protected virtual bool TryGetClassificationType(string word, out ClassificationType classificationType)
Parameters
System.String
word
The string word. |
ClassificationType
classificationType
The result classification type. |
Returns
System.Boolean
Returns true if classification type is found, otherwise - false. |
TryRemoveWord(String)
Tries to removes a given word from the dictionary.
Declaration
public bool TryRemoveWord(string word)
Parameters
System.String
word
|
Returns
System.Boolean
|