次の方法で共有


InkAnalyzerBase.GetNodesFromTextRange メソッド (Int32%, Int32%)

指定したテキスト範囲に関連するコンテキスト ノードのコレクションを返します。

名前空間 :  System.Windows.Ink.AnalysisCore
アセンブリ :  IACore (IACore.dll 内)

構文

'宣言
Public Function GetNodesFromTextRange ( _
    ByRef start As Integer, _
    ByRef length As Integer _
) As ContextNodeBaseCollection
'使用
Dim instance As InkAnalyzerBase
Dim start As Integer
Dim length As Integer
Dim returnValue As ContextNodeBaseCollection

returnValue = instance.GetNodesFromTextRange(start, _
    length)
public ContextNodeBaseCollection GetNodesFromTextRange(
    ref int start,
    ref int length
)
public:
ContextNodeBaseCollection^ GetNodesFromTextRange(
    int% start, 
    int% length
)
public ContextNodeBaseCollection GetNodesFromTextRange(
    /** @ref */int start,
    /** @ref */int length
)
public function GetNodesFromTextRange(
    start : int, 
    length : int
) : ContextNodeBaseCollection

パラメータ

  • start
    型 : System.Int32%
    認識された文字列のテキスト範囲の開始点への参照。
  • length
    型 : System.Int32%
    認識された文字列のテキスト範囲の長さへの参照。

戻り値

型 : System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection
指定したテキスト範囲に関連するコンテキスト ノードのコレクション。

解説

このメソッドは、テキスト範囲を最も近い単語境界に拡張することにより、start パラメータおよび length パラメータの値を変更します。

たとえば、認識された文字列が "I am late" の場合に、start にパラメータ値 6 を使用し、length にパラメータ値 1 を使用して ("late" の文字 "a" に対応する) このメソッドを呼び出すと、このメソッドは単一の ContextNodeBase が含まれているコレクションを返します。コレクションには、"late" という語に対応するインク単語またはテキスト単語のノードが含まれます。この例では、このメソッドはさらに start の値を 5 に変更し、length の値を 4 に変更します (単語 "late" に対応する)。

次の例では、InkAnalyzerBase、theInkAnalyzerBase の認識された上位の文字列の最初の 5 文字が含まれるコンテキスト ノードを取得します。また、これらのノードの分析代替候補を取得し、ヘルパ メソッド ShowAlternates を使用して代替候補を表示します。

If 5 < theInkAnalyzerBase.GetRecognizedString().Length Then
    ' Get the nodes that correspond to the first five
    ' characters of the results for the ink analyzer.
    Dim selectionStart As Integer = 0
    Dim selectionLength As Integer = 5
    Dim selectedSubNodes As System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection = _
        theInkAnalyzerBase.GetNodesFromTextRange( _
            selectionStart, selectionLength)

    ' 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 < theInkAnalyzerBase.GetRecognizedString().Length)
{
    // Get the nodes that correspond to the first five
    // characters of the results for the ink analyzer.
    int selectionStart = 0;
    int selectionLength = 5;
    System.Windows.Ink.AnalysisCore.ContextNodeBaseCollection selectedSubNodes =
        theInkAnalyzerBase.GetNodesFromTextRange(
            ref selectionStart, ref selectionLength);

    // 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

参照

参照

InkAnalyzerBase クラス

InkAnalyzerBase メンバ

GetNodesFromTextRange オーバーロード

System.Windows.Ink.AnalysisCore 名前空間

InkAnalyzerBase.GetTextRangeFromNodes