SynonymList
A named set of synonym rules that can be attached to ato widen searches. Read and written the same way as— see,,and.
Constructors
SynonymList()SynonymEntry()Properties
| Name | Type | Access | Description |
|---|---|---|---|
Name | string | get/set | The symbolic name this list is stored and looked up under. |
Description | string | get/set | Free-text description of what the list covers. Optional. |
UpdatedUtc | DateTimeOffset | get/set | When the list was last modified. |
Entries | List<SynonymEntry> | get/set | InvalidateThe rules in the list. Replacing this collection drops the lookup index built from it;
mutating it in place does not, so callafter an in-place edit. |
Direction | SynonymDirection | get/set | Whetherare mutually equivalent or reachable only from. |
Source | string | get/set | The term that triggers the expansion whenis. Null forentries, where every term inis its own trigger. |
Terms | string[] | get/set | The terms this entry contributes to the query. May contain multi-word terms
("sosialt arbeid", "kognitiv atferdsterapi"); those are matched as whole word
sequences, not as loose words. |
Methods
Expand
string Expand(string queryText, Char[] delimiters = null)stringqueryTextChar[]delimiters— Default: null
Returns: string
Invalidate
Drops the cached lookup index so it is rebuilt on the next. Only needed after mutatingin place.
void Invalidate()GetSerialized
Returns the instance serialized as a JSON string.
string GetSerialized()Returns: string
SaveToFile
Serializes the list to a file.
void SaveToFile(string fileName)stringfileName
Deserialize
GetSerializedDeserializes an instance from a JSON string produced by.
static SynonymList Deserialize(string serialized)stringserialized
Returns: SynonymList
ReadFromFile
Deserializes an instance from a previously saved file.
static SynonymList ReadFromFile(string fileName)stringfileName
Returns: SynonymList
SynonymDirectionenum
SynonymEntryWhether aexpands in both directions or only one.
| Name | Value |
|---|---|
Multidirectional | 0 |
OneWay | 1 |