How to get the document is being processe in SemanticParser?

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Peter Luo - AIMNEXT
Version: 4.0.0285
Avatar
Hi,

In SemanticParser, how to get the document is being processed?
Or, after the parser completed, in SyntaxLanguage class, how to get the tokens of the SemanticParser processed(the copied version tokens from document)?

Thanks a lot!

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Peter,

The SemanticParserServiceRequest.SemanticParseDataTarget property generally will be a Document, so you could get the ref from that (check to make sure it's a Document first though) but note that by doing that you are going to be generally accessing it from the worker thread, which could lead to threading issues.

A better design is probably to return an ISemanticParseData object from your semantic parser that includes the tokens in it. Then in your SyntaxEditor.DocumentSemanticParseDataChanged event (which fires when the Document.SemanticParseData property changes and is fired on the main UI thread) you could compare the data in your parse data with the document's tokens and update as needed.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.