用于解析 Latex 或 MathML 字符串的 Java 或 scala 库
我需要将大量方程和数学公式存储到数据库中以进行模拟实验,我认为最好使用一些 mathML 或乳胶字符串...但是...
I need to store a lot of equation and mathematical formula into database for my simulation experimentations, and i think it's better to use some mathML or latex string... but ...
我提出了一些谷歌搜索请求,我很惊讶,因为我在 java 或 scala 中找不到任何 eval 库来将字符串乳胶或字符串 mathML 表达式转换为 java/scala 中的方程.我不想用求解器评估()非常复杂的方程,我的目标是真的"将简单方程(多项式、线性)存储并转换为 scala/java 语言.
I make some googling request, and i'm very surprised because i don't find any eval library in java or scala to transform string latex or string mathML expression into equation in java / scala. I don't want to eval() very complex equation with solver, my objective is "really" to store and transform simple equation (polynomial, linear) into scala/java language.
您有什么建议可以帮助我理解在用 java 或 scala 语言进行字符串评估后是否有其他解决方案可以轻松存储和解析方程或数学公式?
Do you have some advice to help me understand if there are other solution to store and parse easily equation or mathematic formula after string evaluation in java or scala language ?
更新 1:
最后我找到了一些读取 et eval() 字符串公式的 java 库......如果你找到任何东西,我可以用你的建议完成这个列表.
Finally i find some java library which read et eval() string formula ... If you find anything, i can complete this list with your proposal.
无需解析 MathML/Latex :
http://www.singularsys.com/jep/(未打开-来源)
https://github.com/darius/expr(开源,年轻的图书馆?)
https://github.com/darius/expr (open-source, young library ?)
http://jeval.sourceforge.net/(开源,很老释放)
http://projects.congrace.de/exp4j/index.html(开源,2011 年最后一个版本,maven 存储库,由 @fas 开发)
http://projects.congrace.de/exp4j/index.html (open-source, last release 2011, maven repository, developped by @fas)
https://github.com/MarkyVasconcelos/Towel/wiki/Expression(开源,由 @marcos-vasconcelos 开发)
数学表达式解析器来自我的 Symja 项目 =>参考 stackOverflow 上的这篇文章(Java Math(s) Parsing API)
math expression parser from my Symja project => cf this post on stackOverflow (Java Math(s) Parsing API)
借助 MathML 的实验性解析
jscl-meditor - github 上的存储库 Java 符号计算库和数学编辑器(开源,2011 年最后一个版本,出色的前端和编辑器,mathML 输入/输出(在这里查看教程),很大的可能性:多项式系统求解、向量和矩阵、分解、导数、积分(有理函数)、布尔代数、化简、java代码生成、几何代数)
jscl-meditor - depository on github Java symbolic computing library and mathematical editor (open-source, last release 2011, great front end and editor, mathML input/output (see tutorial here), great possibilities: polynomial system solving, vectors & matrices, factorization, derivatives, integrals (rational functions), boolean algebra, simplification, java code generation, geometric algebra)
JScience 看起来它对引入的 MathML 有一些实验性的支持.(参见这些帖子:使用JScience解析mathml文档和MathML 和 Java)
JScience looks like it has some experimental support for MathML being introduced. (cf these post : Parsing mathml document using JScience and MathML and Java)
在这里上课:http://jscience.org/experimental/javadoc/org/w3c/dom/mathml/package-tree.html
谢谢
推荐答案
如果你想要像我认为你所要求的那样复杂的东西,唯一想到的是与 Java 生态系统兼容的是 Clojuratica,即便如此,您也必须以 Mathematica 格式存储公式.(并拥有 Mathematica 的副本.)
If you want something as sophisticated as I think you are asking for, the only thing that comes to mind that's Java-ecosystem compatible is Clojuratica, and even then you'd have to store the formulae in Mathematica format. (And have a copy of Mathematica.)
相关文章