Skip to main content

Did You Mean

The Did You Mean feature facilitates the use of the didYouMean property for a result to propose some correction for it to easily apply to the query.

Usage

sample.component.ts
import { DidYouMeanComponent } from "@angular/atomic-angular";

@Component({
selector: "sample-component",
template: `
@if (result()) {
<app-did-you-mean [result]="result()" />
}
`,
})
export class SampleComponent {
result = signal<Result | undefined>(undefined);
}

Properties

PropertyTypeDescription
resultinput<Result>The query result
spellingCorrectionModecomputed<SpellingCorrectionMode>The correction mode (see SpellingCorrectionMode type in @sinequa/atomic for details)
correctioncomputed<string>The suggested correction
originalcomputed<string>The original text from the query to be corrected

Methods

MethodDescription
selectCorrected()Changes the query with the correction
selectOriginal()Forces the original text to be used by the search