locked
Using InkAnalyzer alternative word suggestions (c# wpf) RRS feed

  • Question

  • Hi,

    I've been pondering this for a while now. Say I have an ink canvas, which has been anaylzed using an InkAnalyzer object. This now returns a load of nodes describing the text writen on the canvas. I use this code:

    void m_InkAnalyserEmail_ResultsUpdated(object sender, ResultsUpdatedEventArgs e)
            {
                m_CurrentEmailText = "";
                if (e.Status.Successful)
                {
                    StrokeCollection altNodeStrokes = null;
                    ContextNodeCollection nodeCollection = m_InkAnalyserEmail.FindLeafNodes();
    
    ... Etc
    Now, for each code you are able to see alternatives to what the word may actually be. I use this code to find them:

    foreach (AnalysisAlternate alt in m_InkAnalyserEmail.GetAlternates(nodeStrokes))
                        {
    Etc...
    * (where nodeStrokes are the ink strokes of the word I want to find alternatives for)

    The problem is, that AnalysisAnternate doesn't give a Context Node, the same type as nodeStrokes, so I can't simply assign nodeStrokes to be the new altnernative choice.

    I guess I'm a bit stuck on how to implement swapping in alternative words in the node tree generated from the ink canvas.

    I guess the next time the canvas gets analysed again the tree will be rereshed and changes would be lost I guess.

    If anyone's done anything like this or has suggestions on how to achieve this, I'd be more than grateful to hear them!

    Hope this all makes sense!

    Thanks!

    Andy.



    Monday, September 28, 2009 5:16 PM

Answers