({{, (RefLink[AmbiguityFunction, paclet:ref/AmbiguityFunction]) 
is an option for (RefLink[SemanticInterpretation, paclet:ref/SemanticInterpretation]), (RefLink[Interpreter, paclet:ref/Interpreter]), and related functions that specifies how to resolve ambiguities generated during semantic interpretation.}})

OpenersNotesSection(Spacer1)Details

Common settings are:

(RefLink[AmbiguityFunction, paclet:ref/AmbiguityFunction]) is typically given as a function to be applied to expressions containing (RefLink[AmbiguityList, paclet:ref/AmbiguityList]) objects.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (6)

Get the most probable interpretation:

SemanticInterpretation["congo",AmbiguityFunction->Automatic]

Get all interpretations:

SemanticInterpretation["congo",AmbiguityFunction->All]

Print and return all interpretations:

SemanticInterpretation["congo",AmbiguityFunction->((Print[#]; #)&)]

Manually select the first interpretation:

SemanticInterpretation["congo",AmbiguityFunction->(Replace[#,al_AmbiguityList:>al[[1,1]],{0,Infinity},Heads->True]&)]

Select only interpretations as countries:

SemanticInterpretation["congo",Entity["Country",_],AmbiguityFunction->All]

Ambiguities to be resolved may be nested:

SemanticInterpretation["12 8/10",AmbiguityFunction->All]

Choose the date interpretation in month/day/year form:

SemanticInterpretation["12 8/10",_DateObject,AmbiguityFunction->(Replace[#,al_AmbiguityList:>Extract[al[[1]],Position[#["Value"]&/@al[[3]],{"Month","Day","Year"}]],{0,Infinity}]&)]

OpenersExampleSection2(Spacer1)Properties & Relations  (1)

AmbiguityFunction->All is equivalent to AmbiguityFunction->Identity:

SemanticInterpretation["12 8/10",AmbiguityFunction->All]===SemanticInterpretation["12 8/10",AmbiguityFunction->Identity]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[AmbiguityList, paclet:ref/AmbiguityList])  ▪  (RefLink[SemanticInterpretation, paclet:ref/SemanticInterpretation])  ▪  (RefLink[Interpreter, paclet:ref/Interpreter])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Free-Form & External Input, paclet:guide/FreeFormAndExternalInput])}, {▪(RefLinkPlain[Setting Up Input Interpreters, paclet:guide/InterpretingStrings])}, {▪(RefLinkPlain[Programmable Linguistic Interface, paclet:guide/ProgrammableLinguisticInterface])}, {▪(RefLinkPlain[Text Manipulation, paclet:guide/ProcessingTextualData])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/35-natural-language-understanding.html])(WebLink[: Natural Language Understanding, https://www.wolfram.com/language/elementary-introduction/35-natural-language-understanding.html])}})}})