Helper class to extract and process search tags from objects. The search tags can be kept individually or embedded as hash tags inside text like "This text has #hash_tag that can be used for search."
More...
|
static string | NormalizeTag (string tag) |
| Normalizes a tag by replacing special symbols like '_' and '#' with spaces. When tags are normalized then can be presented to user in similar shape and form. More...
|
|
static string | CompressTag (string tag) |
| Compress a tag by removing special symbols like spaces, '_' and '#' and converting the tag to lower case. When tags are compressed they can be matched in search queries. More...
|
|
static bool | EqualTags (string tag1, string tag2) |
| Compares two tags using their compressed form. More...
|
|
static string [] | NormalizeTags (string[] tags) |
| Normalizes a list of tags. More...
|
|
static string [] | NormalizeTagList (string tagList) |
| Normalizes a comma-separated list of tags. More...
|
|
static List< T > | Splice< T > (this List< T > source, int index, int count) |
|
static string [] | CompressTags (string[] tags) |
| Compresses a list of tags. More...
|
|
static string [] | CompressTagList (string tagList) |
| Compresses a comma-separated list of tags. More...
|
|
static string [] | ExtractHashTags (string text) |
| Extracts hash tags from a text. More...
|
|
static string [] | ExtractHashTagsFromValue (dynamic obj, params string[] searchFields) |
| Extracts hash tags from selected fields in an object. More...
|
|
|
static string | ExtractString (dynamic field) |
|
|
const string | NORMALIZE_REGEX = "(_|#)+" |
|
const string | COMPRESS_REGEX = "( |_|#)+" |
|
const string | SPLIT_REGEX = "(,|;)+" |
|
const string | HASHTAG_REGEX = "#\\w+" |
|
Helper class to extract and process search tags from objects. The search tags can be kept individually or embedded as hash tags inside text like "This text has #hash_tag that can be used for search."
◆ CompressTag()
static string PipServices3.Commons.Data.TagsProcessor.CompressTag |
( |
string |
tag | ) |
|
|
static |
Compress a tag by removing special symbols like spaces, '_' and '#' and converting the tag to lower case. When tags are compressed they can be matched in search queries.
- Parameters
-
- Returns
- a compressed tag.
◆ CompressTagList()
static string [] PipServices3.Commons.Data.TagsProcessor.CompressTagList |
( |
string |
tagList | ) |
|
|
static |
Compresses a comma-separated list of tags.
- Parameters
-
tagList | a comma-separated list of tags to compress. |
- Returns
- a list with compressed tags.
◆ CompressTags()
static string [] PipServices3.Commons.Data.TagsProcessor.CompressTags |
( |
string [] |
tags | ) |
|
|
static |
Compresses a list of tags.
- Parameters
-
tags | the tags to compress. |
- Returns
- a list with normalized tags.
◆ EqualTags()
static bool PipServices3.Commons.Data.TagsProcessor.EqualTags |
( |
string |
tag1, |
|
|
string |
tag2 |
|
) |
| |
|
static |
Compares two tags using their compressed form.
- Parameters
-
tag1 | the first tag. |
tag2 | the second tag. |
- Returns
- true if the tags are equal and false otherwise.
◆ ExtractHashTags()
static string [] PipServices3.Commons.Data.TagsProcessor.ExtractHashTags |
( |
string |
text | ) |
|
|
static |
Extracts hash tags from a text.
- Parameters
-
text | a text that contains hash tags |
- Returns
- a list with extracted and compressed tags.
◆ ExtractHashTagsFromValue()
static string [] PipServices3.Commons.Data.TagsProcessor.ExtractHashTagsFromValue |
( |
dynamic |
obj, |
|
|
params string [] |
searchFields |
|
) |
| |
|
static |
Extracts hash tags from selected fields in an object.
- Parameters
-
obj | an object which contains hash tags. |
searchFields | a list of fields in the objects where to extract tags |
- Returns
- a list of extracted and compressed tags.
◆ NormalizeTag()
static string PipServices3.Commons.Data.TagsProcessor.NormalizeTag |
( |
string |
tag | ) |
|
|
static |
Normalizes a tag by replacing special symbols like '_' and '#' with spaces. When tags are normalized then can be presented to user in similar shape and form.
- Parameters
-
- Returns
- a normalized tag.
◆ NormalizeTagList()
static string [] PipServices3.Commons.Data.TagsProcessor.NormalizeTagList |
( |
string |
tagList | ) |
|
|
static |
Normalizes a comma-separated list of tags.
- Parameters
-
tagList | a comma-separated list of tags to normalize. |
- Returns
- a list with normalized tags.
◆ NormalizeTags()
static string [] PipServices3.Commons.Data.TagsProcessor.NormalizeTags |
( |
string [] |
tags | ) |
|
|
static |
Normalizes a list of tags.
- Parameters
-
tags | the tags to normalize. |
- Returns
- a list with normalized tags.
The documentation for this class was generated from the following file:
- src/Data/TagsProcessor.cs