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

csharp
SynonymList()
csharp
SynonymEntry()

Properties

NameTypeAccessDescription
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

csharp
string Expand(string queryText, Char[] delimiters = null)
  • string queryText
  • Char[] delimiters — Default: null

Returns: string

Invalidate

Drops the cached lookup index so it is rebuilt on the next. Only needed after mutatingin place.

csharp
void Invalidate()

GetSerialized

Returns the instance serialized as a JSON string.

csharp
string GetSerialized()

Returns: string

SaveToFile

Serializes the list to a file.

csharp
void SaveToFile(string fileName)
  • string fileName

Deserialize

GetSerializedDeserializes an instance from a JSON string produced by.

csharp
static SynonymList Deserialize(string serialized)
  • string serialized

Returns: SynonymList

ReadFromFile

Deserializes an instance from a previously saved file.

csharp
static SynonymList ReadFromFile(string fileName)
  • string fileName

Returns: SynonymList

SynonymDirectionenum

SynonymEntryWhether aexpands in both directions or only one.

NameValue
Multidirectional
0
OneWay
1