如何使用识别器类识别数学符号?
我正在为基于平板电脑的电脑做一个项目,用户可以在其中编写一个要求解的方程。
问题是我正在使用的识别器类 InkAnalyzer
,无法识别我输入的根符号或任何其他数学符号。我有什么办法可以添加这样的功能吗?
基本上,我希望我的程序的功能与 Windows 7 附带的数学输入面板非常相似。哦,我用 C# 编写代码。
I am doing a project for tablet based pc's where the user would write an equation to be solved.
The problem is that the recognizer classes that I am using, InkAnalyzer
, cannot recognize root signs or any other mathematical signs that I input. Is there someway for me to add such functionality?
Basically, I want my program to function much like the math Input Panel that comes with windows 7. Oh, and I code in c#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将墨迹加载到 C# 中的 MathInputControl
中提供的解决方案页讨论如何对数学输入控件进行编程。
将笔画形式的数学方程加载后(您可以从 InkCanvas 控件获取它们 - 如果您不打算从其他地方读取并构造笔画)通过 StylusPointCollection 加载到数学输入控件中,并将它们存储到 StrokeCollection 类中并将其流式传输到ISF(墨水序列化格式)文件。
解决方案作者向数学输入控件提供 ISF 文件。在管理数学输入窗口等之前,还需要做一些更多的工作来获取解决方案。
Load ink to a MathInputControl in C#
The solution provided in the page discusses how to program Math Input Control.
Once you have your math eqn in the form of strokes loaded (you can get them from InkCanvas Control - if you dont plan to read it from elsewhere and construct strokes) into Math Input Control through StylusPointCollection and store them into StrokeCollection class and stream it into an ISF (Ink Serialized Format) file.
The solution author supplies ISF file to Math Input Control. And some more work is involved to get back the solution - before that managing the Math Input window etc,.
我确信这不是您想听到的,但基本上您不能这样做。至少在没有微软内部人员帮助的情况下是这样。为了促进这一点,您需要开发自己的语言识别器。据我所知,这样做的工具和文档没有提供给第三方。
但是,您可以开发自己的识别系统,该系统利用
System.Windows.Ink
API 提供的现有墨迹收集和笔划模型,但它不会插入InkAnalyzer
模型。与仅分析形状的简单 OCR 类型系统相比,利用笔划信息会产生更好的结果。对于微软来说,在 System.Windows.Ink 命名空间中公开他们的数学解析功能非常有用,但随着该功能的推出,微软放弃了平板电脑。然后 iPad 出现并吃了他们的午餐,现在谁知道我们是否会再次看到墨迹输入成为焦点。
I'm sure it's not what you want to hear but basically you can't do this. At least not without insider help at Microsoft. In order to facilitate this, you would need to develop your own language recognizer. And as far as I know, the tools and documentation for doing so are not provided to third parties.
However, you could develop your own recognition system that utilizes the existing ink collection and stroke model provided by the
System.Windows.Ink
API's, but it would not plug into theInkAnalyzer
model. Utilizing the stroke information will yield much better results than a simple OCR type of system where you're simply analyzing shapes.It would have been very useful for Microsoft to expose their math parsing capabilities in the System.Windows.Ink namespace but as that was coming out, Microsoft was giving up on tablets. Then the iPad came along and ate their lunch and now who knows if we'll ever see a focus on ink input again.