다음을 통해 공유


RecognitionResult.GetAlternatesFromSelection 메서드 (Int32, Int32, Int32)

업데이트: 2007년 11월

RecognitionResult 개체의 최적 결과 문자열 내에 있는 범위에서 RecognitionAlternates 컬렉션을 반환합니다. 이 컬렉션의 각 RecognitionAlternate 개체는 잉크 세그먼트 하나에만 해당합니다. 반환된 컬렉션은 지정된 크기로 제한됩니다.

네임스페이스:  Microsoft.Ink
어셈블리:  Microsoft.Ink(Microsoft.Ink.dll)

구문

‘선언
Public Function GetAlternatesFromSelection ( _
    selectionStart As Integer, _
    selectionLength As Integer, _
    maximumAlternates As Integer _
) As RecognitionAlternates
‘사용 방법
Dim instance As RecognitionResult
Dim selectionStart As Integer
Dim selectionLength As Integer
Dim maximumAlternates As Integer
Dim returnValue As RecognitionAlternates

returnValue = instance.GetAlternatesFromSelection(selectionStart, _
    selectionLength, maximumAlternates)
public RecognitionAlternates GetAlternatesFromSelection(
    int selectionStart,
    int selectionLength,
    int maximumAlternates
)
public:
RecognitionAlternates^ GetAlternatesFromSelection(
    int selectionStart, 
    int selectionLength, 
    int maximumAlternates
)
public RecognitionAlternates GetAlternatesFromSelection(
    int selectionStart,
    int selectionLength,
    int maximumAlternates
)
public function GetAlternatesFromSelection(
    selectionStart : int, 
    selectionLength : int, 
    maximumAlternates : int
) : RecognitionAlternates

매개 변수

  • selectionLength
    형식: System.Int32
    RecognitionAlternates 컬렉션을 반환할 텍스트 선택 영역의 길이입니다. 기본값은 선택 영역의 시작 부분과 문자열 끝 사이의 텍스트를 지정하는 -1입니다.
  • maximumAlternates
    형식: System.Int32
    반환할 대체 항목의 최대 개수입니다. 기본값은 10입니다. 인식기에서 난이도나 걸리는 시간으로 인해 대체 항목 개수를 계산할 수 없으면 대체 항목 개수가 임의로 반환됩니다.

반환 값

형식: Microsoft.Ink.RecognitionAlternates
RecognitionResult 개체의 최적 결과 문자열 내에 있는 선택 영역에서 RecognitionAlternates 컬렉션을 반환합니다. 이 컬렉션의 각 RecognitionAlternate 개체는 잉크 세그먼트 하나에만 해당합니다.

설명

참고

범위가 넓은 경우나 특정 언어를 사용할 때는 대체 항목 개수가 지수적으로 증가합니다. 응용 프로그램에서는 인식기가 반환할 수 있는 대체 항목의 최대 개수를 쿼리하는 대신 대체 항목 개수를 직접 지정해야 합니다.

인식기는 세그먼트 사이의 간격에 따라 "how are you"를 각 단어에 하나씩 세그먼트 세 개로 분할합니다. GetAlternatesFromSelection 메서드를 호출하여 이 선택 영역의 세그먼트 하나에 대한 대체 항목을 반환합니다.

GetAlternatesFromSelection 메서드와 RecognitionAlternateAlternatesWithConstantPropertyValues, LineAlternatesConfidenceAlternates 메서드 사이에는 차이점이 있습니다. GetAlternatesFromSelection 메서드는 각 RecognitionAlternate 개체가 선택 영역 내에서 잉크의 세그먼트 하나에만 해당하는 RecognitionAlternates 컬렉션을 반환하지만 AlternatesWithConstantPropertyValues, LineAlternatesConfidenceAlternates 메서드는 RecognitionAlternate 개체가 선택 영역 내에서 잉크의 각 세그먼트에 해당하는 RecognitionAlternates 컬렉션을 반환합니다.

예제

이 C# 예제에서는 이미 RecognitionResult 개체의 최상위 결과로 채워진 TextBox 컨트롤인 theTextBox에서 사용자가 선택한 영역에 대해 최대 5개의 RecognitionAlternate 개체를 반환합니다. GetAlternatesFromSelection 메서드를 사용하여 대체 항목을 RecognitionAlternates 컬렉션인 theRecognitionAlternates에 저장합니다. 이렇게 하면 사용자가 인식된 텍스트를 선택하고 해당 텍스트의 대체 항목을 검색하여 수정할 수 있습니다.

[C#]

using Microsoft.Ink;
// . . .
try
{
    if (theTextBox.SelectionLength != 0)
    {
        RecognitionAlternates theRecognitionAlternates =
            theRecognitionResult.GetAlternatesFromSelection(
                theTextBox.SelectionStart, theTextBox.SelectionLength, 5);
        // Do something with theRecognitionAlternates here.
    }
}
catch
{
    // handle exceptions here.
}

이 Microsoft® Visual Basic® .NET 예제에서는 이미 RecognitionResult 개체의 최상위 결과로 채워진 TextBox 컨트롤인 theTextBox에서 사용자가 선택한 영역에 대해 최대 5개의 RecognitionAlternate 개체를 반환합니다. GetAlternatesFromSelection 메서드를 사용하여 대체 항목을 RecognitionAlternates 컬렉션인 theRecognitionAlternates에 저장합니다. 이렇게 하면 사용자가 인식된 텍스트를 선택하고 해당 텍스트의 대체 항목을 검색하여 수정할 수 있습니다.

[Visual Basic]

Imports Microsoft.Ink
' . . .
Try
    If theTextBox.SelectionLength != 0 Then
        Dim theRecognitionAlternates As RecognitionAlternates
        theRecognitionAlternates = _
            theRecognitionResult.GetAlternatesFromSelection( _
                theTextBox.SelectionStart, _
                theTextBox.SelectionLength, 5)
        'Do something with theRecognitionAlternates here.
    End If
Catch
    'Handle exceptions here.
End Try

플랫폼

Windows Vista

.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

3.0에서 지원

참고 항목

참조

RecognitionResult 클래스

RecognitionResult 멤버

GetAlternatesFromSelection 오버로드

Microsoft.Ink 네임스페이스

GetAlternatesFromSelection

RecognitionAlternates