Add
Collapse the table of content
Expand the table of content

INamedEntityCollector::Add method

Adds a single (potential) named entity to this INamedEntityCollector collection, as identified in a tokenized span of the input string being parsed.

Syntax


HRESULT Add(
  [in] ULONG                  beginSpan,
  [in] ULONG                  endSpan,
  [in] ULONG                  beginActual,
  [in] ULONG                  endActual,
  [in] IEntity                *pType,
  [in] LPCWSTR                pszValue,
  [in] NAMED_ENTITY_CERTAINTY certainty
);

Parameters

beginSpan [in]

Type: ULONG

The beginning of the overall token span, including any leading quotation marks.

endSpan [in]

Type: ULONG

The end of the overall token span including any trailing quotation marks.

beginActual [in]

Type: ULONG

The beginning of the part of the token span that identifies the potential named entity.

endActual [in]

Type: ULONG

The end of the part of the token span that identifies the potential named entity.

pType [in]

Type: IEntity*

The semantic type of the named entity.

pszValue [in]

Type: LPCWSTR

The name of the entity as a string.

certainty [in]

Type: NAMED_ENTITY_CERTAINTY

One of the following values:

ValueInformation
NEC_LOWIt could be this named entity, but additional evidence is advisable.
NEC_MEDIUMIt is likely this named entity; it is okay to use it.
NEC_HIGHIt almost certainly is this named entity; it should be okay to discard other possibilities.

 

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

When a query parser parses an input string into condition nodes, the parser invokes an IConditionGenerator object that, in turn, invokes INamedEntityCollector::Add to collect possible named entities in the input string. The IConditionGenerator object must call this method for each potential named entity it recognizes in the input string. For each entity, the condition generator must provide the following information:

  • what part of the input string it covers
  • the semantic type of the named entity
  • a string representation of the value of the named entity
  • the level of certainty that the input really is that named entity

If the named entity was used in the interpretation of the input string, the GenerateForLeaf method of the condition generator will be invoked with the value string as one of the arguments.

The following relationship must be maintained between the four first arguments: beginSpan = beginActual < endActual = endSpan.

Requirements

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Structuredquery.h

IDL

Structuredquery.idl

 

 

Community Additions

ADD
Show:
© 2016 Microsoft