指定したノードの指定したテキスト範囲に関連するコンテキスト ノードのコレクションを返します。
名前空間 : 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 の値を 4 に変更します (単語 "late" に対応する)。
例
次の例では、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