InkAnalyzerBase.GetNodesFromTextRange 메서드 (Int32%, Int32%, ContextNodeBaseCollection)
업데이트: 2007년 11월
지정된 노드의 지정된 텍스트 범위와 관련된 컨텍스트 노드의 컬렉션을 반환합니다.
네임스페이스: System.Windows.Ink.AnalysisCore
어셈블리: IACore(IACore.dll)
구문
‘선언
Public Function GetNodesFromTextRange ( _
ByRef start As Integer, _
ByRef length As Integer, _
nodesToSearch As ContextNodeBaseCollection _
) As ContextNodeBaseCollection
‘사용 방법
Dim instance As InkAnalyzerBase
Dim start As Integer
Dim length As Integer
Dim nodesToSearch As ContextNodeBaseCollection
Dim returnValue As ContextNodeBaseCollection
returnValue = instance.GetNodesFromTextRange(start, _
length, nodesToSearch)
public ContextNodeBaseCollection GetNodesFromTextRange(
ref int start,
ref int length,
ContextNodeBaseCollection nodesToSearch
)
public:
ContextNodeBaseCollection^ GetNodesFromTextRange(
int% start,
int% length,
ContextNodeBaseCollection^ nodesToSearch
)
public ContextNodeBaseCollection GetNodesFromTextRange(
/** @ref */int start,
/** @ref */int length,
ContextNodeBaseCollection nodesToSearch
)
public function GetNodesFromTextRange(
start : int,
length : int,
nodesToSearch : ContextNodeBaseCollection
) : ContextNodeBaseCollection
매개 변수
- start
형식: System.Int32%
인식된 문자열의 텍스트 범위 시작 부분에 대한 참조입니다.
- length
형식: System.Int32%
인식된 문자열의 텍스트 범위 길이에 대한 참조입니다.
- nodesToSearch
형식: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
검색을 제한할 컨텍스트 노드입니다.
반환 값
형식: System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
지정된 컨텍스트 노드의 지정된 텍스트 범위와 관련된 컨텍스트 노드의 컬렉션입니다.
설명
이 메서드는 텍스트 범위를 가장 가까운 단어 경계로 확장하여 start 및 length 매개 변수의 값을 수정합니다.
참고
start 및 length 매개 변수는 nodesToSearch 매개 변수의 인식된 문자열에 상대적입니다.
예를 들어 인식된 문자열이 "I am late"이고 start의 매개 변수 값으로 6, length의 매개 변수 값으로 1("late"의 문자 "a"에 해당)을 사용하여 이 메서드를 호출하면 이 메서드는 단일 ContextNodeBase가 포함된 컬렉션을 반환합니다. 이 컬렉션에는 "late"라는 단어에 해당하는 잉크 단어나 텍스트 단어 노드가 들어 있습니다. 예를 들어 이 메서드는 start의 값을 5로 수정하고 length의 값을 "late"라는 단어에 해당하는 4로 수정하기도 합니다.
예제
다음 예제에서는 ContextNodeBaseCollection인 theLineNodes의 상위 인식된 문자열에서 처음 5개의 문자가 들어 있는 컨텍스트 노드를 가져옵니다. 이 예제에서 theLineNodes는 InkAnalyzerBase인 theInkAnalyzerBase에 의해 포함됩니다. 예제에서는 해당 노드에 대한 분석 대체 항목을 검색하고 도우미 메서드인 ShowAlternates를 사용하여 해당 대체 항목을 표시합니다.
If 5 < theRecognizedString.Length Then
' Get the nodes that correspond to the first five
' characters of the results for the line nodes.
Dim selectionStart As Integer = 0
Dim selectionLength As Integer = 5
Dim selectedSubNodes As System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection = _
theInkAnalyzerBase.GetNodesFromTextRange( _
selectionStart, selectionLength, theLineNodes)
' Get analysis alternates for corresponding nodes.
Dim theAlternates As System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseCollection = _
theInkAnalyzerBase.GetAlternates(selectedSubNodes)
' Display the alternates using a helper method.
Me.ShowAlternates("Alternates for the selection:", theAlternates)
End If
if (5 < theRecognizedString.Length)
{
// Get the nodes that correspond to the first five
// characters of the results for the line nodes.
int selectionStart = 0;
int selectionLength = 5;
System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection selectedSubNodes =
theInkAnalyzerBase.GetNodesFromTextRange(
ref selectionStart, ref selectionLength, theLineNodes);
// Get analysis alternates for corresponding nodes.
System.Windows.Ink.AnalysisCore.AnalysisAlternateBaseCollection theAlternates =
theInkAnalyzerBase.GetAlternates(selectedSubNodes);
// Display the alternates using a helper method.
this.ShowAlternates(
"Alternates for the selection:", theAlternates);
}
플랫폼
Windows Vista, Windows XP SP2, Windows Server 2003
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Framework
3.0에서 지원