How to use fence method in storybook-root

Best JavaScript code snippet using storybook-root

math_semantic_tree_test.js

Source:math_semantic_tree_test.js Github

copy

Full Screen

1// Copyright 2013 Google Inc.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14/**15 * @fileoverview Testcases for the semantic tree.16 * @author sorge@google.com (Volker Sorge)17 */18goog.provide('cvox.SemanticTreeTest');19goog.require('cvox.AbstractTestCase');20goog.require('cvox.ChromeVoxTester');21goog.require('cvox.SemanticAttr');22goog.require('cvox.SemanticTree');23goog.require('cvox.SemanticUtil');24goog.require('cvox.XpathUtil');25/**26 * @constructor27 * @extends {cvox.AbstractTestCase}28 */29cvox.SemanticTreeTest = function() {30 goog.base(this);31};32goog.inherits(cvox.SemanticTreeTest, cvox.AbstractTestCase);33/**34 * @override35 */36cvox.SemanticTreeTest.prototype.setUpTest = function() {37 this.nodeCounter = 0;38 this.xpathBlacklist = [];39 this.brief = true;40 cvox.SemanticTreeTest.setupAttributes();41};42/**43 * Adds some unicode characters via hex code to the right category.44 *45 * This method is necessary as the test framework can not handle code containing46 * utf-8 encoded characters.47 */48cvox.SemanticTreeTest.setupAttributes = function() {49 var attr = cvox.SemanticAttr.getInstance();50 attr.neutralFences.unshift(cvox.SemanticUtil.numberToUnicode(0x00A6));51 attr.dashes.unshift(cvox.SemanticUtil.numberToUnicode(0x2015));52 attr.neutralFences.unshift(cvox.SemanticUtil.numberToUnicode(0x2016));53 attr.arrows.unshift(cvox.SemanticUtil.numberToUnicode(0x2192));54 attr.sumOps.unshift(cvox.SemanticUtil.numberToUnicode(0x2211));55 attr.additions.unshift(cvox.SemanticUtil.numberToUnicode(0x2213));56 attr.multiplications.unshift(cvox.SemanticUtil.numberToUnicode(0x2218));57 attr.intOps.unshift(cvox.SemanticUtil.numberToUnicode(0x222B));58 attr.inequalities.unshift(cvox.SemanticUtil.numberToUnicode(0x2264));59 attr.additions.unshift(cvox.SemanticUtil.numberToUnicode(0x2295));60 var open = cvox.SemanticUtil.numberToUnicode(0x3008);61 var close = cvox.SemanticUtil.numberToUnicode(0x3009);62 attr.openClosePairs[open] = close;63 attr.leftFences.unshift(open);64 attr.rightFences.unshift(close);65};66/**67 * Removes XML nodes according to the XPath elements in the blacklist.68 * @param {Node} xml Xml representation of the semantic node.69 */70cvox.SemanticTreeTest.prototype.customizeXml = function(xml) {71 this.xpathBlacklist.forEach(72 function(xpath) {73 var removes = cvox.XpathUtil.evalXPath(xpath, xml);74 removes.forEach(75 function(node) {76 node.parentNode.removeChild(node);77 });78 });79};80/**81 * Tests if for a given mathml snippet results in a particular semantic tree.82 * @param {string} mml MathML expression.83 * @param {string} sml XML snippet for the semantic tree.84 */85cvox.SemanticTreeTest.prototype.executeTreeTest = function(mml, sml) {86 var mathMl = '<math id=' + this.nodeCounter + '>' + mml + '';87 this.appendHtml(mathMl);88 var node = document.getElementById((this.nodeCounter++).toString());89 var stree = new cvox.SemanticTree(/** @type {!Element} */(node));90 var sxml = stree.xml(this.brief);91 this.customizeXml(sxml);92 var dp = new DOMParser();93 var xml = dp.parseFromString('<stree>' + sml + '</stree>', 'text/xml');94 var xmls = new XMLSerializer();95 this.assertEquals(xmls.serializeToString(xml), xmls.serializeToString(sxml));96};97// Relations.98/**99 * Test relation trees.100 */101cvox.SemanticTreeTest.prototype.testStreeRelations = function() {102 this.brief = true;103 this.executeTreeTest(104 '<mo>=</mo>',105 '<relation>=</relation>');106 this.executeTreeTest(107 '<mi>a</mi><mo>=</mo><mi>b</mi>',108 '<relseq>=' +109 '<content><relation>=</relation></content>' +110 '<children>' +111 '<identifier>a</identifier>' +112 '<identifier>b</identifier>' +113 '</children>' +114 '</relseq>');115 this.executeTreeTest(116 '<mi>a</mi><mo>=</mo><mi>b</mi><mo>=</mo><mi>c</mi>',117 '<relseq>=' +118 '<content><relation>=</relation><relation>=</relation></content>' +119 '<children>' +120 '<identifier>a</identifier>' +121 '<identifier>b</identifier>' +122 '<identifier>c</identifier>' +123 '</children>' +124 '</relseq>');125 this.executeTreeTest(126 '<mi>a</mi><mo>=</mo><mi>b</mi><mo>=</mo><mi>c</mi>' +127 '<mo>\u2264</mo><mi>d</mi>',128 '<multirel>' +129 '<content><relation>=</relation><relation>=</relation>' +130 '<relation>\u2264</relation></content>' +131 '<children>' +132 '<identifier>a</identifier>' +133 '<identifier>b</identifier>' +134 '<identifier>c</identifier>' +135 '<identifier>d</identifier>' +136 '</children>' +137 '</multirel>');138};139// Operators.140/**141 * Test operator trees with pre- and postfixes.142 */143cvox.SemanticTreeTest.prototype.testStreePrePostfixOperators = function() {144 this.brief = true;145 // Pathological operator only case.146 this.executeTreeTest(147 '<mo>+</mo><mo>-</mo><mo>+</mo>',148 '<prefixop>+' +149 '<content><operator>+</operator></content>' +150 '<children>' +151 '<prefixop>-' +152 '<content><operator>-</operator></content>' +153 '<children>' +154 '<operator>+</operator>' +155 '</children>' +156 '</prefixop>' +157 '</children>' +158 '</prefixop>');159 // Single identifier with prefixes.160 this.executeTreeTest(161 '<mo>+</mo><mo>+</mo><mi>a</mi>',162 '<prefixop>+ +' +163 '<content><operator>+</operator><operator>+</operator></content>' +164 '<children>' +165 '<identifier>a</identifier>' +166 '</children>' +167 '</prefixop>');168 // Single identifier with prefix and negative.169 this.executeTreeTest(170 '<mo>+</mo><mo>-</mo><mi>a</mi>',171 '<prefixop>+' +172 '<content><operator>+</operator></content>' +173 '<children>' +174 '<prefixop>-' +175 '<content><operator>-</operator></content>' +176 '<children>' +177 '<identifier>a</identifier>' +178 '</children>' +179 '</prefixop>' +180 '</children>' +181 '</prefixop>');182 // Single identifier with postfixes.183 this.executeTreeTest(184 '<mi>a</mi><mo>+</mo><mo>-</mo>',185 '<postfixop>+ -' +186 '<content><operator>+</operator><operator>-</operator></content>' +187 '<children>' +188 '<identifier>a</identifier>' +189 '</children>' +190 '</postfixop>');191 // Single identifier with pre- and postfixes.192 this.executeTreeTest(193 '<mo>+</mo><mo>+</mo><mi>a</mi><mo>+</mo><mo>+</mo>',194 '<postfixop>+ +' +195 '<content><operator>+</operator><operator>+</operator></content>' +196 '<children>' +197 '<prefixop>+ +' +198 '<content><operator>+</operator><operator>+</operator></content>' +199 '<children>' +200 '<identifier>a</identifier>' +201 '</children>' +202 '</prefixop>' +203 '</children>' +204 '</postfixop>');205 // Single identifier with mixed pre- and postfixes.206 this.executeTreeTest(207 '<mo>\u2213</mo><mo>+</mo><mi>a</mi><mo>\u2213</mo><mo>+</mo>',208 '<postfixop>\u2213 +' +209 '<content>' +210 '<operator>\u2213</operator><operator>+</operator>' +211 '</content>' +212 '<children>' +213 '<prefixop>\u2213 +' +214 '<content>' +215 '<operator>\u2213</operator><operator>+</operator>' +216 '</content>' +217 '<children>' +218 '<identifier>a</identifier>' +219 '</children>' +220 '</prefixop>' +221 '</children>' +222 '</postfixop>');223 // Two identifiers with pre- and postfixes.224 this.executeTreeTest(225 '<mo>+</mo><mo>+</mo><mi>a</mi><mo>\u2213</mo><mo>+</mo>' +226 '<mi>b</mi><mo>+</mo>',227 '<infixop>\u2213' +228 '<content><operator>\u2213</operator></content>' +229 '<children>' +230 '<prefixop>+ +' +231 '<content><operator>+</operator><operator>+</operator></content>' +232 '<children>' +233 '<identifier>a</identifier>' +234 '</children>' +235 '</prefixop>' +236 '<postfixop>+' +237 '<content><operator>+</operator></content>' +238 '<children>' +239 '<prefixop>+' +240 '<content><operator>+</operator></content>' +241 '<children>' +242 '<identifier>b</identifier>' +243 '</children>' +244 '</prefixop>' +245 '</children>' +246 '</postfixop>' +247 '</children>' +248 '</infixop>');249 // Three identifiers with pre- and postfixes.250 this.executeTreeTest(251 '<mo>+</mo><mo>+</mo><mi>a</mi><mo>\u2213</mo><mo>+</mo>' +252 '<mi>b</mi><mo>+</mo><mo>\u2213</mo><mi>c</mi><mo>+</mo>',253 '<infixop>+' +254 '<content><operator>+</operator></content>' +255 '<children>' +256 '<infixop>\u2213' +257 '<content><operator>\u2213</operator></content>' +258 '<children>' +259 '<prefixop>+ +' +260 '<content><operator>+</operator><operator>+</operator></content>' +261 '<children>' +262 '<identifier>a</identifier>' +263 '</children>' +264 '</prefixop>' +265 '<prefixop>+' +266 '<content><operator>+</operator></content>' +267 '<children>' +268 '<identifier>b</identifier>' +269 '</children>' +270 '</prefixop>' +271 '</children>' +272 '</infixop>' +273 '<postfixop>+' +274 '<content><operator>+</operator></content>' +275 '<children>' +276 '<prefixop>\u2213' +277 '<content><operator>\u2213</operator></content>' +278 '<children>' +279 '<identifier>c</identifier>' +280 '</children>' +281 '</prefixop>' +282 '</children>' +283 '</postfixop>' +284 '</children>' +285 '</infixop>');286};287/**288 * Test operator trees with single operator.289 */290cvox.SemanticTreeTest.prototype.testStreeSingleOperators = function() {291 this.brief = true;292 // Single identifier.293 this.executeTreeTest(294 '<mi>a</mi>',295 '<identifier>a</identifier>');296 // Single implicit node.297 this.executeTreeTest(298 '<mi>a</mi><mi>b</mi>',299 '<infixop>\u2062' +300 '<content><operator>\u2062</operator></content>' +301 '<children>' +302 '<identifier>a</identifier>' +303 '<identifier>b</identifier>' +304 '</children>' +305 '</infixop>');306 // Implicit multi node.307 this.executeTreeTest(308 '<mi>a</mi><mi>b</mi><mi>c</mi>',309 '<infixop>\u2062' +310 '<content><operator>\u2062</operator></content>' +311 '<children>' +312 '<identifier>a</identifier>' +313 '<identifier>b</identifier>' +314 '<identifier>c</identifier>' +315 '</children>' +316 '</infixop>');317 // Single addition.318 this.executeTreeTest(319 '<mi>a</mi><mo>+</mo><mi>b</mi>',320 '<infixop>+' +321 '<content><operator>+</operator></content>' +322 '<children>' +323 '<identifier>a</identifier>' +324 '<identifier>b</identifier>' +325 '</children>' +326 '</infixop>');327 // Multi addition.328 this.executeTreeTest(329 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo><mi>c</mi>',330 '<infixop>+' +331 '<content><operator>+</operator><operator>+</operator></content>' +332 '<children>' +333 '<identifier>a</identifier>' +334 '<identifier>b</identifier>' +335 '<identifier>c</identifier>' +336 '</children>' +337 '</infixop>');338 // Multi addition with implicit node.339 this.executeTreeTest(340 '<mi>a</mi><mo>+</mo><mi>b</mi><mi>c</mi><mo>+</mo><mi>d</mi>',341 '<infixop>+' +342 '<content><operator>+</operator><operator>+</operator></content>' +343 '<children>' +344 '<identifier>a</identifier>' +345 '<infixop>\u2062' +346 '<content><operator>\u2062</operator></content>' +347 '<children>' +348 '<identifier>b</identifier>' +349 '<identifier>c</identifier>' +350 '</children>' +351 '</infixop>' +352 '<identifier>d</identifier>' +353 '</children>' +354 '</infixop>');355};356/**357 * Test operator trees with multiple operators.358 */359cvox.SemanticTreeTest.prototype.testStreeMultipleOperators = function() {360 this.brief = true;361 // Addition and subtraction.362 this.executeTreeTest(363 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>-</mo><mi>c</mi><mo>+</mo><mi>d</mi>',364 '<infixop>+' +365 '<content><operator>+</operator></content>' +366 '<children>' +367 '<infixop>-' +368 '<content><operator>-</operator></content>' +369 '<children>' +370 '<infixop>+' +371 '<content><operator>+</operator></content>' +372 '<children>' +373 '<identifier>a</identifier>' +374 '<identifier>b</identifier>' +375 '</children>' +376 '</infixop>' +377 '<identifier>c</identifier>' +378 '</children>' +379 '</infixop>' +380 '<identifier>d</identifier>' +381 '</children>' +382 '</infixop>');383 // Addition and subtraction.384 this.executeTreeTest(385 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo><mi>c</mi><mo>-</mo>' +386 '<mi>d</mi><mo>-</mo><mi>e</mi>',387 '<infixop>-' +388 '<content><operator>-</operator><operator>-</operator></content>' +389 '<children>' +390 '<infixop>+' +391 '<content><operator>+</operator><operator>+</operator></content>' +392 '<children>' +393 '<identifier>a</identifier>' +394 '<identifier>b</identifier>' +395 '<identifier>c</identifier>' +396 '</children>' +397 '</infixop>' +398 '<identifier>d</identifier>' +399 '<identifier>e</identifier>' +400 '</children>' +401 '</infixop>');402 // Addition and explicit multiplication.403 this.executeTreeTest(404 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>\u2218</mo><mi>c</mi><mo>+</mo><mi>d</mi>',405 '<infixop>+' +406 '<content><operator>+</operator><operator>+</operator></content>' +407 '<children>' +408 '<identifier>a</identifier>' +409 '<infixop>\u2218' +410 '<content><operator>\u2218</operator></content>' +411 '<children>' +412 '<identifier>b</identifier>' +413 '<identifier>c</identifier>' +414 '</children>' +415 '</infixop>' +416 '<identifier>d</identifier>' +417 '</children>' +418 '</infixop>');419 // Addition with explicit and implicit multiplication.420 this.executeTreeTest(421 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>\u2218</mo><mi>c</mi><mi>d</mi>' +422 '<mo>+</mo><mi>e</mi><mo>\u2218</mo><mi>f</mi>',423 '<infixop>+' +424 '<content><operator>+</operator><operator>+</operator></content>' +425 '<children>' +426 '<identifier>a</identifier>' +427 '<infixop>\u2218' +428 '<content><operator>\u2218</operator></content>' +429 '<children>' +430 '<identifier>b</identifier>' +431 '<infixop>\u2062' +432 '<content><operator>\u2062</operator></content>' +433 '<children>' +434 '<identifier>c</identifier>' +435 '<identifier>d</identifier>' +436 '</children>' +437 '</infixop>' +438 '</children>' +439 '</infixop>' +440 '<infixop>\u2218' +441 '<content><operator>\u2218</operator></content>' +442 '<children>' +443 '<identifier>e</identifier>' +444 '<identifier>f</identifier>' +445 '</children>' +446 '</infixop>' +447 '</children>' +448 '</infixop>');449 // Two Additions, subtraction plus explicit and implicit multiplication,450 // one prefix and one postfix.451 this.executeTreeTest(452 '<mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo><mi>c</mi><mi>d</mi>' +453 '<mo>+</mo><mi>e</mi><mo>\u2218</mo><mi>f</mi><mo>-</mo><mi>g</mi>' +454 '<mo>+</mo><mo>+</mo><mi>h</mi><mo>\u2295</mo><mi>i</mi>' +455 '<mo>\u2295</mo><mi>j</mi><mo>+</mo><mo>+</mo>',456 '<infixop>\u2295' +457 '<content><operator>\u2295</operator>' +458 '<operator>\u2295</operator></content>' +459 '<children>' +460 '<infixop>+' +461 '<content><operator>+</operator></content>' +462 '<children>' +463 '<infixop>-' +464 '<content><operator>-</operator></content>' +465 '<children>' +466 '<infixop>+' +467 '<content><operator>+</operator>' +468 '<operator>+</operator><operator>+</operator></content>' +469 '<children>' +470 '<identifier>a</identifier>' +471 '<identifier>b</identifier>' +472 '<infixop>\u2062' +473 '<content><operator>\u2062</operator></content>' +474 '<children>' +475 '<identifier>c</identifier>' +476 '<identifier>d</identifier>' +477 '</children>' +478 '</infixop>' +479 '<infixop>\u2218' +480 '<content><operator>\u2218</operator></content>' +481 '<children>' +482 '<identifier>e</identifier>' +483 '<identifier>f</identifier>' +484 '</children>' +485 '</infixop>' +486 '</children>' +487 '</infixop>' +488 '<identifier>g</identifier>' +489 '</children>' +490 '</infixop>' +491 '<prefixop>+' +492 '<content><operator>+</operator></content>' +493 '<children>' +494 '<identifier>h</identifier>' +495 '</children>' +496 '</prefixop>' +497 '</children>' +498 '</infixop>' +499 '<identifier>i</identifier>' +500 '<postfixop>+ +' +501 '<content><operator>+</operator><operator>+</operator></content>' +502 '<children>' +503 '<identifier>j</identifier>' +504 '</children>' +505 '</postfixop>' +506 '</children>' +507 '</infixop>');508};509// Fences.510/**511 * Test regular directed fences.512 */513cvox.SemanticTreeTest.prototype.testStreeRegularFences = function() {514 this.brief = true;515 // No fence.516 this.executeTreeTest(517 '<mrow><mi>a</mi><mo>+</mo><mi>b</mi></mrow>',518 '<infixop>+' +519 '<content>' +520 '<operator>+</operator>' +521 '</content>' +522 '<children>' +523 '<identifier>a</identifier>' +524 '<identifier>b</identifier>' +525 '</children>' +526 '</infixop>');527 // Empty parentheses.528 this.executeTreeTest(529 '<mrow><mo>(</mo><mo>)</mo></mrow>',530 '<fenced>' +531 '<content>' +532 '<fence>(</fence>' +533 '<fence>)</fence>' +534 '</content>' +535 '<children>' +536 '<empty/>' +537 '</children>' +538 '</fenced>');539 // Single Fenced Expression.540 this.executeTreeTest(541 '<mrow><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo></mrow>',542 '<fenced>' +543 '<content>' +544 '<fence>(</fence>' +545 '<fence>)</fence>' +546 '</content>' +547 '<children>' +548 '<infixop>+' +549 '<content>' +550 '<operator>+</operator>' +551 '</content>' +552 '<children>' +553 '<identifier>a</identifier>' +554 '<identifier>b</identifier>' +555 '</children>' +556 '</infixop>' +557 '</children>' +558 '</fenced>');559 // Single Fenced Expression and operators.560 this.executeTreeTest(561 '<mrow><mi>a</mi><mo>+</mo><mo>(</mo><mi>b</mi><mo>+</mo><mi>c</mi>' +562 '<mo>)</mo><mo>+</mo><mi>d</mi></mrow>',563 '<infixop>+' +564 '<content>' +565 '<operator>+</operator>' +566 '<operator>+</operator>' +567 '</content>' +568 '<children>' +569 '<identifier>a</identifier>' +570 '<fenced>' +571 '<content>' +572 '<fence>(</fence>' +573 '<fence>)</fence>' +574 '</content>' +575 '<children>' +576 '<infixop>+' +577 '<content>' +578 '<operator>+</operator>' +579 '</content>' +580 '<children>' +581 '<identifier>b</identifier>' +582 '<identifier>c</identifier>' +583 '</children>' +584 '</infixop>' +585 '</children>' +586 '</fenced>' +587 '<identifier>d</identifier>' +588 '</children>' +589 '</infixop>');590 // Parallel Parenthesis.591 this.executeTreeTest(592 '<mrow><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo><mo>(</mo>' +593 '<mi>c</mi><mo>+</mo><mi>d</mi><mo>)</mo></mrow>',594 '<infixop>\u2062' +595 '<content>' +596 '<operator>\u2062</operator>' +597 '</content>' +598 '<children>' +599 '<fenced>' +600 '<content>' +601 '<fence>(</fence>' +602 '<fence>)</fence>' +603 '</content>' +604 '<children>' +605 '<infixop>+' +606 '<content>' +607 '<operator>+</operator>' +608 '</content>' +609 '<children>' +610 '<identifier>a</identifier>' +611 '<identifier>b</identifier>' +612 '</children>' +613 '</infixop>' +614 '</children>' +615 '</fenced>' +616 '<fenced>' +617 '<content>' +618 '<fence>(</fence>' +619 '<fence>)</fence>' +620 '</content>' +621 '<children>' +622 '<infixop>+' +623 '<content>' +624 '<operator>+</operator>' +625 '</content>' +626 '<children>' +627 '<identifier>c</identifier>' +628 '<identifier>d</identifier>' +629 '</children>' +630 '</infixop>' +631 '</children>' +632 '</fenced>' +633 '</children>' +634 '</infixop>');635 // Nested Parenthesis.636 this.executeTreeTest(637 '<mrow><mo>(</mo><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo>' +638 '<mo>(</mo><mi>c</mi><mo>+</mo><mi>d</mi><mo>)</mo><mo>)</mo></mrow>',639 '<fenced>' +640 '<content>' +641 '<fence>(</fence>' +642 '<fence>)</fence>' +643 '</content>' +644 '<children>' +645 '<infixop>\u2062' +646 '<content>' +647 '<operator>\u2062</operator>' +648 '</content>' +649 '<children>' +650 '<fenced>' +651 '<content>' +652 '<fence>(</fence>' +653 '<fence>)</fence>' +654 '</content>' +655 '<children>' +656 '<infixop>+' +657 '<content>' +658 '<operator>+</operator>' +659 '</content>' +660 '<children>' +661 '<identifier>a</identifier>' +662 '<identifier>b</identifier>' +663 '</children>' +664 '</infixop>' +665 '</children>' +666 '</fenced>' +667 '<fenced>' +668 '<content>' +669 '<fence>(</fence>' +670 '<fence>)</fence>' +671 '</content>' +672 '<children>' +673 '<infixop>+' +674 '<content>' +675 '<operator>+</operator>' +676 '</content>' +677 '<children>' +678 '<identifier>c</identifier>' +679 '<identifier>d</identifier>' +680 '</children>' +681 '</infixop>' +682 '</children>' +683 '</fenced>' +684 '</children>' +685 '</infixop>' +686 '</children>' +687 '</fenced>');688 // Nested parenthesis and brackets.689 this.executeTreeTest(690 '<mrow><mo>(</mo><mo>[</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>+</mo>' +691 '<mi>c</mi><mo>]</mo><mo>+</mo><mi>d</mi><mo>)</mo></mrow>',692 '<fenced>' +693 '<content>' +694 '<fence>(</fence>' +695 '<fence>)</fence>' +696 '</content>' +697 '<children>' +698 '<infixop>+' +699 '<content>' +700 '<operator>+</operator>' +701 '</content>' +702 '<children>' +703 '<fenced>' +704 '<content>' +705 '<fence>[</fence>' +706 '<fence>]</fence>' +707 '</content>' +708 '<children>' +709 '<infixop>+' +710 '<content>' +711 '<operator>+</operator>' +712 '<operator>+</operator>' +713 '</content>' +714 '<children>' +715 '<identifier>a</identifier>' +716 '<identifier>b</identifier>' +717 '<identifier>c</identifier>' +718 '</children>' +719 '</infixop>' +720 '</children>' +721 '</fenced>' +722 '<identifier>d</identifier>' +723 '</children>' +724 '</infixop>' +725 '</children>' +726 '</fenced>');727 // Nested parenthesis, brackets, braces and superscript operator.728 this.executeTreeTest(729 '<mrow><mo>(</mo><msup><mi>a</mi><mrow><mn>2</mn><mo>[</mo><mi>i</mi>' +730 '<mo>+</mo><mi>n</mi><mo>]</mo></mrow></msup><mo>+</mo><mi>b</mi>' +731 '<mo>)</mo><mo>+</mo><mo>{</mo><mi>c</mi><mi>d</mi><mo>-</mo><mo>[</mo>' +732 '<mi>e</mi><mo>+</mo><mi>f</mi><mo>]</mo><mo>}</mo></mrow>',733 '<infixop>+' +734 '<content>' +735 '<operator>+</operator>' +736 '</content>' +737 '<children>' +738 '<fenced>' +739 '<content>' +740 '<fence>(</fence>' +741 '<fence>)</fence>' +742 '</content>' +743 '<children>' +744 '<infixop>+' +745 '<content>' +746 '<operator>+</operator>' +747 '</content>' +748 '<children>' +749 '<superscript>' +750 '<children>' +751 '<identifier>a</identifier>' +752 '<infixop>\u2062' +753 '<content>' +754 '<operator>\u2062</operator>' +755 '</content>' +756 '<children>' +757 '<number>2</number>' +758 '<fenced>' +759 '<content>' +760 '<fence>[</fence>' +761 '<fence>]</fence>' +762 '</content>' +763 '<children>' +764 '<infixop>+' +765 '<content>' +766 '<operator>+</operator>' +767 '</content>' +768 '<children>' +769 '<identifier>i</identifier>' +770 '<identifier>n</identifier>' +771 '</children>' +772 '</infixop>' +773 '</children>' +774 '</fenced>' +775 '</children>' +776 '</infixop>' +777 '</children>' +778 '</superscript>' +779 '<identifier>b</identifier>' +780 '</children>' +781 '</infixop>' +782 '</children>' +783 '</fenced>' +784 '<fenced>' +785 '<content>' +786 '<fence>{</fence>' +787 '<fence>}</fence>' +788 '</content>' +789 '<children>' +790 '<infixop>-' +791 '<content>' +792 '<operator>-</operator>' +793 '</content>' +794 '<children>' +795 '<infixop>\u2062' +796 '<content>' +797 '<operator>\u2062</operator>' +798 '</content>' +799 '<children>' +800 '<identifier>c</identifier>' +801 '<identifier>d</identifier>' +802 '</children>' +803 '</infixop>' +804 '<fenced>' +805 '<content>' +806 '<fence>[</fence>' +807 '<fence>]</fence>' +808 '</content>' +809 '<children>' +810 '<infixop>+' +811 '<content>' +812 '<operator>+</operator>' +813 '</content>' +814 '<children>' +815 '<identifier>e</identifier>' +816 '<identifier>f</identifier>' +817 '</children>' +818 '</infixop>' +819 '</children>' +820 '</fenced>' +821 '</children>' +822 '</infixop>' +823 '</children>' +824 '</fenced>' +825 '</children>' +826 '</infixop>');827};828/**829 * Test neutral fences.830 */831cvox.SemanticTreeTest.prototype.testStreeNeutralFences = function() {832 this.brief = true;833 // Empty bars.834 this.executeTreeTest(835 '<mrow><mo>|</mo><mo>|</mo></mrow>',836 '<fenced>' +837 '<content>' +838 '<fence>|</fence>' +839 '<fence>|</fence>' +840 '</content>' +841 '<children>' +842 '<empty/>' +843 '</children>' +844 '</fenced>');845 // Simple bar fence.846 this.executeTreeTest(847 '<mrow><mo>|</mo><mi>a</mi><mo>|</mo></mrow>',848 '<fenced>' +849 '<content>' +850 '<fence>|</fence>' +851 '<fence>|</fence>' +852 '</content>' +853 '<children>' +854 '<identifier>a</identifier>' +855 '</children>' +856 '</fenced>');857 // Parallel bar fences.858 this.executeTreeTest(859 '<mrow><mo>|</mo><mi>a</mi><mo>|</mo><mi>b</mi><mo>+</mo>' +860 '<mo>\u00A6</mo><mi>c</mi><mo>\u00A6</mo></mrow>',861 '<infixop>+' +862 '<content>' +863 '<operator>+</operator>' +864 '</content>' +865 '<children>' +866 '<infixop>\u2062' +867 '<content>' +868 '<operator>\u2062</operator>' +869 '</content>' +870 '<children>' +871 '<fenced>' +872 '<content>' +873 '<fence>|</fence>' +874 '<fence>|</fence>' +875 '</content>' +876 '<children>' +877 '<identifier>a</identifier>' +878 '</children>' +879 '</fenced>' +880 '<identifier>b</identifier>' +881 '</children>' +882 '</infixop>' +883 '<fenced>' +884 '<content>' +885 '<fence>\u00A6</fence>' +886 '<fence>\u00A6</fence>' +887 '</content>' +888 '<children>' +889 '<identifier>c</identifier>' +890 '</children>' +891 '</fenced>' +892 '</children>' +893 '</infixop>');894 // Nested bar fences.895 this.executeTreeTest(896 '<mrow><mo>\u00A6</mo><mo>|</mo><mi>a</mi><mo>|</mo><mi>b</mi>' +897 '<mo>+</mo><mi>c</mi><mo>\u00A6</mo></mrow>',898 '<fenced>' +899 '<content>' +900 '<fence>\u00A6</fence>' +901 '<fence>\u00A6</fence>' +902 '</content>' +903 '<children>' +904 '<infixop>+' +905 '<content>' +906 '<operator>+</operator>' +907 '</content>' +908 '<children>' +909 '<infixop>\u2062' +910 '<content>' +911 '<operator>\u2062</operator>' +912 '</content>' +913 '<children>' +914 '<fenced>' +915 '<content>' +916 '<fence>|</fence>' +917 '<fence>|</fence>' +918 '</content>' +919 '<children>' +920 '<identifier>a</identifier>' +921 '</children>' +922 '</fenced>' +923 '<identifier>b</identifier>' +924 '</children>' +925 '</infixop>' +926 '<identifier>c</identifier>' +927 '</children>' +928 '</infixop>' +929 '</children>' +930 '</fenced>');931};932/**933 * Mixed neutral and regular fences.934 */935cvox.SemanticTreeTest.prototype.testStreeMixedFences = function() {936 this.brief = true;937 // Empty parenthsis inside bars.938 this.executeTreeTest(939 '<mrow><mo>|</mo><mo>(</mo><mo>)</mo><mo>|</mo></mrow>',940 '<fenced>' +941 '<content>' +942 '<fence>|</fence>' +943 '<fence>|</fence>' +944 '</content>' +945 '<children>' +946 '<fenced>' +947 '<content>' +948 '<fence>(</fence>' +949 '<fence>)</fence>' +950 '</content>' +951 '<children>' +952 '<empty/>' +953 '</children>' +954 '</fenced>' +955 '</children>' +956 '</fenced>');957 // Bars inside parentheses.958 this.executeTreeTest(959 '<mrow><mo>(</mo><mo>|</mo><mi>a</mi><mo>|</mo><mi>b</mi>' +960 '<mo>&#x00A6;</mo><mi>c</mi><mo>&#x00A6;</mo><mi>d</mi>' +961 '<mo>)</mo></mrow>',962 '<fenced>' +963 '<content>' +964 '<fence>(</fence>' +965 '<fence>)</fence>' +966 '</content>' +967 '<children>' +968 '<infixop>\u2062' +969 '<content>' +970 '<operator>\u2062</operator>' +971 '</content>' +972 '<children>' +973 '<fenced>' +974 '<content>' +975 '<fence>|</fence>' +976 '<fence>|</fence>' +977 '</content>' +978 '<children>' +979 '<identifier>a</identifier>' +980 '</children>' +981 '</fenced>' +982 '<identifier>b</identifier>' +983 '<fenced>' +984 '<content>' +985 '<fence>\u00A6</fence>' +986 '<fence>\u00A6</fence>' +987 '</content>' +988 '<children>' +989 '<identifier>c</identifier>' +990 '</children>' +991 '</fenced>' +992 '<identifier>d</identifier>' +993 '</children>' +994 '</infixop>' +995 '</children>' +996 '</fenced>');997 // Parentheses inside bards.998 this.executeTreeTest(999 '<mrow><mo>|</mo><mo>(</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>)</mo>' +1000 '<mo>&#x00A6;</mo><mi>c</mi><mo>&#x00A6;</mo><mi>d</mi><mo>|</mo></mrow>',1001 '<fenced>' +1002 '<content>' +1003 '<fence>|</fence>' +1004 '<fence>|</fence>' +1005 '</content>' +1006 '<children>' +1007 '<infixop>\u2062' +1008 '<content>' +1009 '<operator>\u2062</operator>' +1010 '</content>' +1011 '<children>' +1012 '<fenced>' +1013 '<content>' +1014 '<fence>(</fence>' +1015 '<fence>)</fence>' +1016 '</content>' +1017 '<children>' +1018 '<infixop>+' +1019 '<content>' +1020 '<operator>+</operator>' +1021 '</content>' +1022 '<children>' +1023 '<identifier>a</identifier>' +1024 '<identifier>b</identifier>' +1025 '</children>' +1026 '</infixop>' +1027 '</children>' +1028 '</fenced>' +1029 '<fenced>' +1030 '<content>' +1031 '<fence>\u00A6</fence>' +1032 '<fence>\u00A6</fence>' +1033 '</content>' +1034 '<children>' +1035 '<identifier>c</identifier>' +1036 '</children>' +1037 '</fenced>' +1038 '<identifier>d</identifier>' +1039 '</children>' +1040 '</infixop>' +1041 '</children>' +1042 '</fenced>');1043 // Parentheses inside bards.1044 this.executeTreeTest(1045 '<mrow><mo>[</mo><mo>|</mo><mi>a</mi><mo>+</mo><mi>b</mi><mo>|</mo>' +1046 '<mo>+</mo><mi>c</mi><mo>]</mo><mo>+</mo><mo>\u00A6</mo><mi>d</mi>' +1047 '<mo>+</mo><mo>(</mo><mi>e</mi><mo>+</mo><mi>f</mi><mo>)</mo>' +1048 '<mo>\u00A6</mo></mrow>',1049 '<infixop>+' +1050 '<content>' +1051 '<operator>+</operator>' +1052 '</content>' +1053 '<children>' +1054 '<fenced>' +1055 '<content>' +1056 '<fence>[</fence>' +1057 '<fence>]</fence>' +1058 '</content>' +1059 '<children>' +1060 '<infixop>+' +1061 '<content>' +1062 '<operator>+</operator>' +1063 '</content>' +1064 '<children>' +1065 '<fenced>' +1066 '<content>' +1067 '<fence>|</fence>' +1068 '<fence>|</fence>' +1069 '</content>' +1070 '<children>' +1071 '<infixop>+' +1072 '<content>' +1073 '<operator>+</operator>' +1074 '</content>' +1075 '<children>' +1076 '<identifier>a</identifier>' +1077 '<identifier>b</identifier>' +1078 '</children>' +1079 '</infixop>' +1080 '</children>' +1081 '</fenced>' +1082 '<identifier>c</identifier>' +1083 '</children>' +1084 '</infixop>' +1085 '</children>' +1086 '</fenced>' +1087 '<fenced>' +1088 '<content>' +1089 '<fence>\u00A6</fence>' +1090 '<fence>\u00A6</fence>' +1091 '</content>' +1092 '<children>' +1093 '<infixop>+' +1094 '<content>' +1095 '<operator>+</operator>' +1096 '</content>' +1097 '<children>' +1098 '<identifier>d</identifier>' +1099 '<fenced>' +1100 '<content>' +1101 '<fence>(</fence>' +1102 '<fence>)</fence>' +1103 '</content>' +1104 '<children>' +1105 '<infixop>+' +1106 '<content>' +1107 '<operator>+</operator>' +1108 '</content>' +1109 '<children>' +1110 '<identifier>e</identifier>' +1111 '<identifier>f</identifier>' +1112 '</children>' +1113 '</infixop>' +1114 '</children>' +1115 '</fenced>' +1116 '</children>' +1117 '</infixop>' +1118 '</children>' +1119 '</fenced>' +1120 '</children>' +1121 '</infixop>');1122};1123/**1124 * Mixed with isolated bars.1125 */1126cvox.SemanticTreeTest.prototype.testStreeMixedFencesWithBars = function() {1127 this.brief = true;1128 this.xpathBlacklist = ['descendant::punctuated/content'];1129 // Set notation.1130 this.executeTreeTest(1131 '<mrow><mo>{</mo><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi><mo>,</mo>' +1132 '<mi>z</mi><mo>)</mo><mo>|</mo><mi>x</mi><mi>y</mi><mo>=</mo>' +1133 '<mo>z</mo><mo>}</mo></mrow>',1134 '<fenced>' +1135 '<content>' +1136 '<fence>{</fence>' +1137 '<fence>}</fence>' +1138 '</content>' +1139 '<children>' +1140 '<punctuated>' +1141 '<children>' +1142 '<fenced>' +1143 '<content>' +1144 '<fence>(</fence>' +1145 '<fence>)</fence>' +1146 '</content>' +1147 '<children>' +1148 '<punctuated>' +1149 '<children>' +1150 '<identifier>x</identifier>' +1151 '<punctuation>,</punctuation>' +1152 '<identifier>y</identifier>' +1153 '<punctuation>,</punctuation>' +1154 '<identifier>z</identifier>' +1155 '</children>' +1156 '</punctuated>' +1157 '</children>' +1158 '</fenced>' +1159 '<punctuation>|</punctuation>' +1160 '<relseq>=' +1161 '<content>' +1162 '<relation>=</relation>' +1163 '</content>' +1164 '<children>' +1165 '<infixop>\u2062' +1166 '<content>' +1167 '<operator>\u2062</operator>' +1168 '</content>' +1169 '<children>' +1170 '<identifier>x</identifier>' +1171 '<identifier>y</identifier>' +1172 '</children>' +1173 '</infixop>' +1174 '<identifier>z</identifier>' +1175 '</children>' +1176 '</relseq>' +1177 '</children>' +1178 '</punctuated>' +1179 '</children>' +1180 '</fenced>');1181 // Disjunction of bracketed parallel statements.1182 this.executeTreeTest(1183 '<mrow><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>]</mo>' +1184 '<mo>|</mo><mo>[</mo><mi>x</mi><mo>&#x2016;</mo><mi>y</mi><mo>]</mo>' +1185 '</mrow>',1186 '<punctuated>' +1187 '<children>' +1188 '<fenced>' +1189 '<content>' +1190 '<fence>[</fence>' +1191 '<fence>]</fence>' +1192 '</content>' +1193 '<children>' +1194 '<punctuated>' +1195 '<children>' +1196 '<identifier>a</identifier>' +1197 '<punctuation>\u2016</punctuation>' +1198 '<identifier>b</identifier>' +1199 '</children>' +1200 '</punctuated>' +1201 '</children>' +1202 '</fenced>' +1203 '<punctuation>|</punctuation>' +1204 '<fenced>' +1205 '<content>' +1206 '<fence>[</fence>' +1207 '<fence>]</fence>' +1208 '</content>' +1209 '<children>' +1210 '<punctuated>' +1211 '<children>' +1212 '<identifier>x</identifier>' +1213 '<punctuation>\u2016</punctuation>' +1214 '<identifier>y</identifier>' +1215 '</children>' +1216 '</punctuated>' +1217 '</children>' +1218 '</fenced>' +1219 '</children>' +1220 '</punctuated>'1221 );1222 // Metric over the above.1223 this.executeTreeTest(1224 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo>' +1225 '<mi>b</mi><mo>]</mo><mo>|</mo><mo>[</mo><mi>x</mi><mo>&#x2016;</mo>' +1226 '<mi>y</mi><mo>]</mo><mo>&#x2016;</mo></mrow>',1227 '<fenced>' +1228 '<content>' +1229 '<fence>\u2016</fence>' +1230 '<fence>\u2016</fence>' +1231 '</content>' +1232 '<children>' +1233 '<punctuated>' +1234 '<children>' +1235 '<fenced>' +1236 '<content>' +1237 '<fence>[</fence>' +1238 '<fence>]</fence>' +1239 '</content>' +1240 '<children>' +1241 '<punctuated>' +1242 '<children>' +1243 '<identifier>a</identifier>' +1244 '<punctuation>\u2016</punctuation>' +1245 '<identifier>b</identifier>' +1246 '</children>' +1247 '</punctuated>' +1248 '</children>' +1249 '</fenced>' +1250 '<punctuation>|</punctuation>' +1251 '<fenced>' +1252 '<content>' +1253 '<fence>[</fence>' +1254 '<fence>]</fence>' +1255 '</content>' +1256 '<children>' +1257 '<punctuated>' +1258 '<children>' +1259 '<identifier>x</identifier>' +1260 '<punctuation>\u2016</punctuation>' +1261 '<identifier>y</identifier>' +1262 '</children>' +1263 '</punctuated>' +1264 '</children>' +1265 '</fenced>' +1266 '</children>' +1267 '</punctuated>' +1268 '</children>' +1269 '</fenced>');1270 // Mix of metrics and bracketed expression and single bars.1271 this.executeTreeTest(1272 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1273 '<mo>]</mo><mo>|</mo><mo>[</mo><mi>c</mi><mo>&#x2016;</mo>' +1274 '<mo>&#x00A6;</mo><mi>d</mi><mo>]</mo><mo>&#x2016;</mo><mo>[</mo>' +1275 '<mi>u</mi><mo>&#x2016;</mo><mi>v</mi><mo>]</mo><mo>|</mo><mi>x</mi>' +1276 '<mo>&#x2016;</mo><mi>y</mi><mo>&#x00A6;</mo><mi>z</mi></mrow>',1277 '<punctuated>' +1278 '<children>' +1279 '<infixop>\u2062' +1280 '<content>' +1281 '<operator>\u2062</operator>' +1282 '</content>' +1283 '<children>' +1284 '<fenced>' +1285 '<content>' +1286 '<fence>\u2016</fence>' +1287 '<fence>\u2016</fence>' +1288 '</content>' +1289 '<children>' +1290 '<punctuated>' +1291 '<children>' +1292 '<fenced>' +1293 '<content>' +1294 '<fence>[</fence>' +1295 '<fence>]</fence>' +1296 '</content>' +1297 '<children>' +1298 '<punctuated>' +1299 '<children>' +1300 '<identifier>a</identifier>' +1301 '<punctuation>\u2016</punctuation>' +1302 '<identifier>b</identifier>' +1303 '</children>' +1304 '</punctuated>' +1305 '</children>' +1306 '</fenced>' +1307 '<punctuation>|</punctuation>' +1308 '<fenced>' +1309 '<content>' +1310 '<fence>[</fence>' +1311 '<fence>]</fence>' +1312 '</content>' +1313 '<children>' +1314 '<punctuated>' +1315 '<children>' +1316 '<identifier>c</identifier>' +1317 '<punctuation>\u2016</punctuation>' +1318 '<punctuation>\u00A6</punctuation>' +1319 '<identifier>d</identifier>' +1320 '</children>' +1321 '</punctuated>' +1322 '</children>' +1323 '</fenced>' +1324 '</children>' +1325 '</punctuated>' +1326 '</children>' +1327 '</fenced>' +1328 '<fenced>' +1329 '<content>' +1330 '<fence>[</fence>' +1331 '<fence>]</fence>' +1332 '</content>' +1333 '<children>' +1334 '<punctuated>' +1335 '<children>' +1336 '<identifier>u</identifier>' +1337 '<punctuation>\u2016</punctuation>' +1338 '<identifier>v</identifier>' +1339 '</children>' +1340 '</punctuated>' +1341 '</children>' +1342 '</fenced>' +1343 '</children>' +1344 '</infixop>' +1345 '<punctuation>|</punctuation>' +1346 '<identifier>x</identifier>' +1347 '<punctuation>\u2016</punctuation>' +1348 '<identifier>y</identifier>' +1349 '<punctuation>\u00A6</punctuation>' +1350 '<identifier>z</identifier>' +1351 '</children>' +1352 '</punctuated>');1353 this.xpathBlacklist = [];1354};1355/**1356 * Pathological cases with only opening fences.1357 */1358cvox.SemanticTreeTest.prototype.testStreeOpeningFencesOnly = function() {1359 this.brief = true;1360 this.xpathBlacklist = ['descendant::punctuated/content'];1361 // Single.1362 this.executeTreeTest(1363 '<mrow><mo>[</mo></mrow>',1364 '<fence>[</fence>');1365 // Single right.1366 this.executeTreeTest(1367 '<mrow><mi>a</mi><mo>[</mo></mrow>',1368 '<punctuated>' +1369 '<children>' +1370 '<identifier>a</identifier>' +1371 '<punctuation>[</punctuation>' +1372 '</children>' +1373 '</punctuated>');1374 // Single middle.1375 this.executeTreeTest(1376 '<mrow><mi>a</mi><mo>[</mo><mi>b</mi></mrow>',1377 '<punctuated>' +1378 '<children>' +1379 '<identifier>a</identifier>' +1380 '<punctuation>[</punctuation>' +1381 '<identifier>b</identifier>' +1382 '</children>' +1383 '</punctuated>');1384 // Single left.1385 this.executeTreeTest(1386 '<mrow><mo>[</mo><mi>b</mi></mrow>',1387 '<punctuated>' +1388 '<children>' +1389 '<punctuation>[</punctuation>' +1390 '<identifier>b</identifier>' +1391 '</children>' +1392 '</punctuated>');1393 // Multiple.1394 this.executeTreeTest(1395 '<mrow><mi>a</mi><mo>[</mo><mi>b</mi><mi>c</mi><mo>(</mo><mi>d</mi>' +1396 '<mo>{</mo><mi>e</mi><mo>&#x3008;</mo><mi>f</mi></mrow>',1397 '<punctuated>' +1398 '<children>' +1399 '<identifier>a</identifier>' +1400 '<punctuation>[</punctuation>' +1401 '<infixop>\u2062' +1402 '<content>' +1403 '<operator>\u2062</operator>' +1404 '</content>' +1405 '<children>' +1406 '<identifier>b</identifier>' +1407 '<identifier>c</identifier>' +1408 '</children>' +1409 '</infixop>' +1410 '<punctuation>(</punctuation>' +1411 '<identifier>d</identifier>' +1412 '<punctuation>{</punctuation>' +1413 '<identifier>e</identifier>' +1414 '<punctuation>\u3008</punctuation>' +1415 '<identifier>f</identifier>' +1416 '</children>' +1417 '</punctuated>');1418 // Multiple plus inner fenced.1419 this.executeTreeTest(1420 '<mrow><mi>a</mi><mo>[</mo><mi>b</mi><mo>[</mo><mo>(</mo><mo>(</mo>' +1421 '<mi>c</mi><mo>)</mo><mi>d</mi><mo>{</mo><mi>e</mi><mo>&#x3008;</mo>' +1422 '<mi>f</mi></mrow>',1423 '<punctuated>' +1424 '<children>' +1425 '<identifier>a</identifier>' +1426 '<punctuation>[</punctuation>' +1427 '<identifier>b</identifier>' +1428 '<punctuation>[</punctuation>' +1429 '<punctuation>(</punctuation>' +1430 '<infixop>\u2062' +1431 '<content>' +1432 '<operator>\u2062</operator>' +1433 '</content>' +1434 '<children>' +1435 '<fenced>' +1436 '<content>' +1437 '<fence>(</fence>' +1438 '<fence>)</fence>' +1439 '</content>' +1440 '<children>' +1441 '<identifier>c</identifier>' +1442 '</children>' +1443 '</fenced>' +1444 '<identifier>d</identifier>' +1445 '</children>' +1446 '</infixop>' +1447 '<punctuation>{</punctuation>' +1448 '<identifier>e</identifier>' +1449 '<punctuation>\u3008</punctuation>' +1450 '<identifier>f</identifier>' +1451 '</children>' +1452 '</punctuated>');1453 this.xpathBlacklist = [];1454};1455/**1456 * Pathological cases with only closing fences.1457 */1458cvox.SemanticTreeTest.prototype.testStreeClosingFencesOnly = function() {1459 this.brief = true;1460 this.xpathBlacklist = ['descendant::punctuated/content'];1461 // Single.1462 this.executeTreeTest(1463 '<mrow><mo>]</mo></mrow>',1464 '<fence>]</fence>');1465 // Single right.1466 this.executeTreeTest(1467 '<mrow><mi>a</mi><mo>]</mo></mrow>',1468 '<punctuated>' +1469 '<children>' +1470 '<identifier>a</identifier>' +1471 '<punctuation>]</punctuation>' +1472 '</children>' +1473 '</punctuated>');1474 // Single middle.1475 this.executeTreeTest(1476 '<mrow><mi>a</mi><mo>]</mo><mi>b</mi></mrow>',1477 '<punctuated>' +1478 '<children>' +1479 '<identifier>a</identifier>' +1480 '<punctuation>]</punctuation>' +1481 '<identifier>b</identifier>' +1482 '</children>' +1483 '</punctuated>');1484 // Single left.1485 this.executeTreeTest(1486 '<mrow><mo>]</mo><mi>b</mi></mrow>',1487 '<punctuated>' +1488 '<children>' +1489 '<punctuation>]</punctuation>' +1490 '<identifier>b</identifier>' +1491 '</children>' +1492 '</punctuated>');1493 // Multiple.1494 this.executeTreeTest(1495 '<mrow><mi>a</mi><mo>]</mo><mi>b</mi><mi>c</mi><mo>)</mo><mi>d</mi>' +1496 '<mo>}</mo><mi>e</mi><mo>&#x3009;</mo><mi>f</mi></mrow>',1497 '<punctuated>' +1498 '<children>' +1499 '<identifier>a</identifier>' +1500 '<punctuation>]</punctuation>' +1501 '<infixop>\u2062' +1502 '<content>' +1503 '<operator>\u2062</operator>' +1504 '</content>' +1505 '<children>' +1506 '<identifier>b</identifier>' +1507 '<identifier>c</identifier>' +1508 '</children>' +1509 '</infixop>' +1510 '<punctuation>)</punctuation>' +1511 '<identifier>d</identifier>' +1512 '<punctuation>}</punctuation>' +1513 '<identifier>e</identifier>' +1514 '<punctuation>\u3009</punctuation>' +1515 '<identifier>f</identifier>' +1516 '</children>' +1517 '</punctuated>');1518 // Multiple plus inner fenced.1519 this.executeTreeTest(1520 '<mrow><mi>a</mi><mo>]</mo><mi>b</mi><mo>]</mo><mo>(</mo><mi>c</mi>' +1521 '<mo>)</mo><mo>)</mo><mi>d</mi><mo>}</mo><mi>e</mi><mo>&#x3009;</mo>' +1522 '<mi>f</mi></mrow>',1523 '<punctuated>' +1524 '<children>' +1525 '<identifier>a</identifier>' +1526 '<punctuation>]</punctuation>' +1527 '<identifier>b</identifier>' +1528 '<punctuation>]</punctuation>' +1529 '<fenced>' +1530 '<content>' +1531 '<fence>(</fence>' +1532 '<fence>)</fence>' +1533 '</content>' +1534 '<children>' +1535 '<identifier>c</identifier>' +1536 '</children>' +1537 '</fenced>' +1538 '<punctuation>)</punctuation>' +1539 '<identifier>d</identifier>' +1540 '<punctuation>}</punctuation>' +1541 '<identifier>e</identifier>' +1542 '<punctuation>\u3009</punctuation>' +1543 '<identifier>f</identifier>' +1544 '</children>' +1545 '</punctuated>');1546 this.xpathBlacklist = [];1547};1548/**1549 * Pathological cases with only neutral fences.1550 */1551cvox.SemanticTreeTest.prototype.testStreeNeutralFencesOnly = function() {1552 this.brief = true;1553 this.xpathBlacklist = ['descendant::punctuated/content'];1554 // Single.1555 this.executeTreeTest(1556 '<mrow><mo>|</mo></mrow>',1557 '<fence>|</fence>');1558 // Single right.1559 this.executeTreeTest(1560 '<mrow><mi>a</mi><mo>|</mo></mrow>',1561 '<punctuated>' +1562 '<children>' +1563 '<identifier>a</identifier>' +1564 '<punctuation>|</punctuation>' +1565 '</children>' +1566 '</punctuated>');1567 // Single middle.1568 this.executeTreeTest(1569 '<mrow><mi>a</mi><mo>|</mo><mi>b</mi></mrow>',1570 '<punctuated>' +1571 '<children>' +1572 '<identifier>a</identifier>' +1573 '<punctuation>|</punctuation>' +1574 '<identifier>b</identifier>' +1575 '</children>' +1576 '</punctuated>');1577 // Single left.1578 this.executeTreeTest(1579 '<mrow><mo>|</mo><mi>b</mi></mrow>',1580 '<punctuated>' +1581 '<children>' +1582 '<punctuation>|</punctuation>' +1583 '<identifier>b</identifier>' +1584 '</children>' +1585 '</punctuated>');1586 // Two different bars.1587 this.executeTreeTest(1588 '<mrow><mi>a</mi><mo>|</mo><mi>b</mi><mo>&#x00A6;</mo><mi>c</mi></mrow>',1589 '<punctuated>' +1590 '<children>' +1591 '<identifier>a</identifier>' +1592 '<punctuation>|</punctuation>' +1593 '<identifier>b</identifier>' +1594 '<punctuation>\u00A6</punctuation>' +1595 '<identifier>c</identifier>' +1596 '</children>' +1597 '</punctuated>');1598 // Three different bars.1599 this.executeTreeTest(1600 '<mrow><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>|</mo><mi>c</mi>' +1601 '<mo>&#x00A6;</mo><mi>d</mi></mrow>',1602 '<punctuated>' +1603 '<children>' +1604 '<identifier>a</identifier>' +1605 '<punctuation>\u2016</punctuation>' +1606 '<identifier>b</identifier>' +1607 '<punctuation>|</punctuation>' +1608 '<identifier>c</identifier>' +1609 '<punctuation>\u00A6</punctuation>' +1610 '<identifier>d</identifier>' +1611 '</children>' +1612 '</punctuated>');1613 // Multiple plus inner fenced.1614 this.executeTreeTest(1615 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1616 '<mo>]</mo><mo>&#x2016;</mo><mo>|</mo><mi>x</mi><mo>&#x2016;</mo>' +1617 '<mi>y</mi><mo>&#x00A6;</mo><mi>z</mi></mrow>',1618 '<punctuated>' +1619 '<children>' +1620 '<fenced>' +1621 '<content>' +1622 '<fence>\u2016</fence>' +1623 '<fence>\u2016</fence>' +1624 '</content>' +1625 '<children>' +1626 '<fenced>' +1627 '<content>' +1628 '<fence>[</fence>' +1629 '<fence>]</fence>' +1630 '</content>' +1631 '<children>' +1632 '<punctuated>' +1633 '<children>' +1634 '<identifier>a</identifier>' +1635 '<punctuation>\u2016</punctuation>' +1636 '<identifier>b</identifier>' +1637 '</children>' +1638 '</punctuated>' +1639 '</children>' +1640 '</fenced>' +1641 '</children>' +1642 '</fenced>' +1643 '<punctuation>|</punctuation>' +1644 '<identifier>x</identifier>' +1645 '<punctuation>\u2016</punctuation>' +1646 '<identifier>y</identifier>' +1647 '<punctuation>\u00A6</punctuation>' +1648 '<identifier>z</identifier>' +1649 '</children>' +1650 '</punctuated>');1651 this.xpathBlacklist = [];1652};1653/**1654 * Pathological cases with mixed fences.1655 */1656cvox.SemanticTreeTest.prototype.testStreeMixedUnmatchedFences = function() {1657 this.brief = true;1658 this.xpathBlacklist = ['descendant::punctuated/content'];1659 // Close, neutral, open.1660 this.executeTreeTest(1661 '<mrow><mo>]</mo><mo>&#x2016;</mo><mi>b</mi><mo>|</mo><mi>c</mi>' +1662 '<mo>(</mo></mrow>',1663 '<punctuated>' +1664 '<children>' +1665 '<punctuation>]</punctuation>' +1666 '<punctuation>\u2016</punctuation>' +1667 '<identifier>b</identifier>' +1668 '<punctuation>|</punctuation>' +1669 '<identifier>c</identifier>' +1670 '<punctuation>(</punctuation>' +1671 '</children>' +1672 '</punctuated>');1673 // Neutrals and close.1674 this.executeTreeTest(1675 '<mrow><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>|</mo><mi>c</mi>' +1676 '<mo>&#x00A6;</mo><mi>d</mi><mo>]</mo><mi>e</mi></mrow>',1677 '<punctuated>' +1678 '<children>' +1679 '<identifier>a</identifier>' +1680 '<punctuation>\u2016</punctuation>' +1681 '<identifier>b</identifier>' +1682 '<punctuation>|</punctuation>' +1683 '<identifier>c</identifier>' +1684 '<punctuation>\u00A6</punctuation>' +1685 '<identifier>d</identifier>' +1686 '<punctuation>]</punctuation>' +1687 '<identifier>e</identifier>' +1688 '</children>' +1689 '</punctuated>');1690 // Neutrals and open.1691 this.executeTreeTest(1692 '<mrow><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi><mo>|</mo>' +1693 '<mi>c</mi><mo>&#x00A6;</mo><mi>d</mi></mrow>',1694 '<punctuated>' +1695 '<children>' +1696 '<punctuation>[</punctuation>' +1697 '<identifier>a</identifier>' +1698 '<punctuation>\u2016</punctuation>' +1699 '<identifier>b</identifier>' +1700 '<punctuation>|</punctuation>' +1701 '<identifier>c</identifier>' +1702 '<punctuation>\u00A6</punctuation>' +1703 '<identifier>d</identifier>' +1704 '</children>' +1705 '</punctuated>');1706 // Multiple fences, fenced and operations1707 this.executeTreeTest(1708 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1709 '<mo>]</mo><mo>|</mo><mo>[</mo><mi>c</mi><mo>&#x2016;</mo>' +1710 '<mo>&#x00A6;</mo><mi>d</mi><mo>]</mo><mo>&#x2016;</mo><mo>|</mo>' +1711 '<mi>x</mi><mo>&#x2016;</mo><mi>y</mi><mo>&#x00A6;</mo><mi>z</mi>' +1712 '<mo>]</mo></mrow>',1713 '<punctuated>' +1714 '<children>' +1715 '<fenced>' +1716 '<content>' +1717 '<fence>\u2016</fence>' +1718 '<fence>\u2016</fence>' +1719 '</content>' +1720 '<children>' +1721 '<punctuated>' +1722 '<children>' +1723 '<fenced>' +1724 '<content>' +1725 '<fence>[</fence>' +1726 '<fence>]</fence>' +1727 '</content>' +1728 '<children>' +1729 '<punctuated>' +1730 '<children>' +1731 '<identifier>a</identifier>' +1732 '<punctuation>\u2016</punctuation>' +1733 '<identifier>b</identifier>' +1734 '</children>' +1735 '</punctuated>' +1736 '</children>' +1737 '</fenced>' +1738 '<punctuation>|</punctuation>' +1739 '<fenced>' +1740 '<content>' +1741 '<fence>[</fence>' +1742 '<fence>]</fence>' +1743 '</content>' +1744 '<children>' +1745 '<punctuated>' +1746 '<children>' +1747 '<identifier>c</identifier>' +1748 '<punctuation>\u2016</punctuation>' +1749 '<punctuation>\u00A6</punctuation>' +1750 '<identifier>d</identifier>' +1751 '</children>' +1752 '</punctuated>' +1753 '</children>' +1754 '</fenced>' +1755 '</children>' +1756 '</punctuated>' +1757 '</children>' +1758 '</fenced>' +1759 '<punctuation>|</punctuation>' +1760 '<identifier>x</identifier>' +1761 '<punctuation>\u2016</punctuation>' +1762 '<identifier>y</identifier>' +1763 '<punctuation>\u00A6</punctuation>' +1764 '<identifier>z</identifier>' +1765 '<punctuation>]</punctuation>' +1766 '</children>' +1767 '</punctuated>');1768 // Multiple fences, fenced and operations1769 this.executeTreeTest(1770 '<mrow><mo>&#x2016;</mo><mo>]</mo><mo>&#x00A6;</mo><mo>&#x2016;</mo>' +1771 '<mo>[</mo><mo>|</mo><mo>[</mo><mi>a</mi><mo>&#x2016;</mo><mi>b</mi>' +1772 '<mo>]</mo><mo>&#x2016;</mo><mo>|</mo><mi>[</mi><mo>&#x2016;</mo>' +1773 '<mi>y</mi><mo>&#x00A6;</mo><mi>z</mi></mrow>',1774 '<punctuated>' +1775 '<children>' +1776 '<fenced>' +1777 '<content>' +1778 '<fence>\u2016</fence>' +1779 '<fence>\u2016</fence>' +1780 '</content>' +1781 '<children>' +1782 '<punctuated>' +1783 '<children>' +1784 '<punctuation>]</punctuation>' +1785 '<punctuation>\u00A6</punctuation>' +1786 '</children>' +1787 '</punctuated>' +1788 '</children>' +1789 '</fenced>' +1790 '<punctuation>[</punctuation>' +1791 '<fenced>' +1792 '<content>' +1793 '<fence>|</fence>' +1794 '<fence>|</fence>' +1795 '</content>' +1796 '<children>' +1797 '<punctuated>' +1798 '<children>' +1799 '<fenced>' +1800 '<content>' +1801 '<fence>[</fence>' +1802 '<fence>]</fence>' +1803 '</content>' +1804 '<children>' +1805 '<punctuated>' +1806 '<children>' +1807 '<identifier>a</identifier>' +1808 '<punctuation>\u2016</punctuation>' +1809 '<identifier>b</identifier>' +1810 '</children>' +1811 '</punctuated>' +1812 '</children>' +1813 '</fenced>' +1814 '<punctuation>\u2016</punctuation>' +1815 '</children>' +1816 '</punctuated>' +1817 '</children>' +1818 '</fenced>' +1819 '<punctuation>[</punctuation>' +1820 '<punctuation>\u2016</punctuation>' +1821 '<identifier>y</identifier>' +1822 '<punctuation>\u00A6</punctuation>' +1823 '<identifier>z</identifier>' +1824 '</children>' +1825 '</punctuated>');1826 // Multiple fences, fenced and operations1827 this.executeTreeTest(1828 '<mrow><mo>&#x2016;</mo><mo>[</mo><mi>a</mi><mo>&#x00A6;</mo>' +1829 '<mo>&#x2016;</mo><mo>[</mo><mo>+</mo><mo>[</mo><mi>b</mi>' +1830 '<mo>&#x2016;</mo><mi>c</mi><mo>]</mo><mo>+</mo><mo>&#x2016;</mo>' +1831 '<mo>|</mo><mi>d</mi><mo>+</mo><mi>e</mi><mi>[</mi><mo>&#x2016;</mo>' +1832 '<mi>y</mi><mo>&#x00A6;</mo><mo>+</mo><mi>z</mi></mrow>',1833 '<punctuated>' +1834 '<children>' +1835 '<punctuation>\u2016</punctuation>' +1836 '<punctuation>[</punctuation>' +1837 '<identifier>a</identifier>' +1838 '<punctuation>\u00A6</punctuation>' +1839 '<punctuation>\u2016</punctuation>' +1840 '<punctuation>[</punctuation>' +1841 '<postfixop>+' +1842 '<content>' +1843 '<operator>+</operator>' +1844 '</content>' +1845 '<children>' +1846 '<prefixop>+' +1847 '<content>' +1848 '<operator>+</operator>' +1849 '</content>' +1850 '<children>' +1851 '<fenced>' +1852 '<content>' +1853 '<fence>[</fence>' +1854 '<fence>]</fence>' +1855 '</content>' +1856 '<children>' +1857 '<punctuated>' +1858 '<children>' +1859 '<identifier>b</identifier>' +1860 '<punctuation>\u2016</punctuation>' +1861 '<identifier>c</identifier>' +1862 '</children>' +1863 '</punctuated>' +1864 '</children>' +1865 '</fenced>' +1866 '</children>' +1867 '</prefixop>' +1868 '</children>' +1869 '</postfixop>' +1870 '<punctuation>\u2016</punctuation>' +1871 '<punctuation>|</punctuation>' +1872 '<infixop>+' +1873 '<content>' +1874 '<operator>+</operator>' +1875 '</content>' +1876 '<children>' +1877 '<identifier>d</identifier>' +1878 '<identifier>e</identifier>' +1879 '</children>' +1880 '</infixop>' +1881 '<punctuation>[</punctuation>' +1882 '<punctuation>\u2016</punctuation>' +1883 '<identifier>y</identifier>' +1884 '<punctuation>\u00A6</punctuation>' +1885 '<prefixop>+' +1886 '<content>' +1887 '<operator>+</operator>' +1888 '</content>' +1889 '<children>' +1890 '<identifier>z</identifier>' +1891 '</children>' +1892 '</prefixop>' +1893 '</children>' +1894 '</punctuated>');1895 this.xpathBlacklist = [];1896};1897/**1898 * Simple function applications1899 */1900cvox.SemanticTreeTest.prototype.testStreeSimpleFuncsSingle = function() {1901 this.brief = true;1902 this.executeTreeTest(1903 '<mrow><mi>f</mi></mrow>',1904 '<identifier>f</identifier>');1905 this.executeTreeTest(1906 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>',1907 '<appl>' +1908 '<content>' +1909 '<punctuation>\u2061</punctuation>' +1910 '</content>' +1911 '<children>' +1912 '<identifier>f</identifier>' +1913 '<fenced>' +1914 '<content>' +1915 '<fence>(</fence>' +1916 '<fence>)</fence>' +1917 '</content>' +1918 '<children>' +1919 '<identifier>x</identifier>' +1920 '</children>' +1921 '</fenced>' +1922 '</children>' +1923 '</appl>');1924 this.executeTreeTest(1925 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mi>y</mi><mo>)</mo></mrow>',1926 '<appl>' +1927 '<content>' +1928 '<punctuation>\u2061</punctuation>' +1929 '</content>' +1930 '<children>' +1931 '<identifier>f</identifier>' +1932 '<fenced>' +1933 '<content>' +1934 '<fence>(</fence>' +1935 '<fence>)</fence>' +1936 '</content>' +1937 '<children>' +1938 '<infixop>\u2062' +1939 '<content>' +1940 '<operator>\u2062</operator>' +1941 '</content>' +1942 '<children>' +1943 '<identifier>x</identifier>' +1944 '<identifier>y</identifier>' +1945 '</children>' +1946 '</infixop>' +1947 '</children>' +1948 '</fenced>' +1949 '</children>' +1950 '</appl>');1951 this.executeTreeTest(1952 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>,</mo><mi>y</mi>' +1953 '<mo>,</mo><mi>z</mi><mo>)</mo></mrow>',1954 '<appl>' +1955 '<content>' +1956 '<punctuation>\u2061</punctuation>' +1957 '</content>' +1958 '<children>' +1959 '<identifier>f</identifier>' +1960 '<fenced>' +1961 '<content>' +1962 '<fence>(</fence>' +1963 '<fence>)</fence>' +1964 '</content>' +1965 '<children>' +1966 '<punctuated>' +1967 '<content>' +1968 '<punctuation>,</punctuation>' +1969 '<punctuation>,</punctuation>' +1970 '</content>' +1971 '<children>' +1972 '<identifier>x</identifier>' +1973 '<punctuation>,</punctuation>' +1974 '<identifier>y</identifier>' +1975 '<punctuation>,</punctuation>' +1976 '<identifier>z</identifier>' +1977 '</children>' +1978 '</punctuated>' +1979 '</children>' +1980 '</fenced>' +1981 '</children>' +1982 '</appl>');1983 this.executeTreeTest(1984 '<mrow><mi>f</mi><mo>(</mo><msup><mi>x</mi><mn>2</mn></msup>' +1985 '<mo>)</mo></mrow>',1986 '<appl>' +1987 '<content>' +1988 '<punctuation>\u2061</punctuation>' +1989 '</content>' +1990 '<children>' +1991 '<identifier>f</identifier>' +1992 '<fenced>' +1993 '<content>' +1994 '<fence>(</fence>' +1995 '<fence>)</fence>' +1996 '</content>' +1997 '<children>' +1998 '<superscript>' +1999 '<children>' +2000 '<identifier>x</identifier>' +2001 '<number>2</number>' +2002 '</children>' +2003 '</superscript>' +2004 '</children>' +2005 '</fenced>' +2006 '</children>' +2007 '</appl>');2008 this.executeTreeTest(2009 '<mrow><mi>f</mi><mo>(</mo><msub><mi>x</mi><mn>2</mn></msub>' +2010 '<mo>)</mo></mrow>',2011 '<appl>' +2012 '<content>' +2013 '<punctuation>\u2061</punctuation>' +2014 '</content>' +2015 '<children>' +2016 '<identifier>f</identifier>' +2017 '<fenced>' +2018 '<content>' +2019 '<fence>(</fence>' +2020 '<fence>)</fence>' +2021 '</content>' +2022 '<children>' +2023 '<subscript>' +2024 '<children>' +2025 '<identifier>x</identifier>' +2026 '<number>2</number>' +2027 '</children>' +2028 '</subscript>' +2029 '</children>' +2030 '</fenced>' +2031 '</children>' +2032 '</appl>');2033 this.executeTreeTest(2034 '<mrow><mi>f</mi><mo>(</mo><msubsup><mi>x</mi><mn>2</mn>' +2035 '<mn>1</mn></msubsup><mo>)</mo></mrow>',2036 '<appl>' +2037 '<content>' +2038 '<punctuation>\u2061</punctuation>' +2039 '</content>' +2040 '<children>' +2041 '<identifier>f</identifier>' +2042 '<fenced>' +2043 '<content>' +2044 '<fence>(</fence>' +2045 '<fence>)</fence>' +2046 '</content>' +2047 '<children>' +2048 '<superscript>' +2049 '<children>' +2050 '<subscript>' +2051 '<children>' +2052 '<identifier>x</identifier>' +2053 '<number>2</number>' +2054 '</children>' +2055 '</subscript>' +2056 '<number>1</number>' +2057 '</children>' +2058 '</superscript>' +2059 '</children>' +2060 '</fenced>' +2061 '</children>' +2062 '</appl>');2063 this.executeTreeTest(2064 '<mrow><mi>f</mi><mo>(</mo><mover><mi>x</mi><mn>2</mn></mover>' +2065 '<mo>)</mo></mrow>',2066 '<appl>' +2067 '<content>' +2068 '<punctuation>\u2061</punctuation>' +2069 '</content>' +2070 '<children>' +2071 '<identifier>f</identifier>' +2072 '<fenced>' +2073 '<content>' +2074 '<fence>(</fence>' +2075 '<fence>)</fence>' +2076 '</content>' +2077 '<children>' +2078 '<overscore>' +2079 '<children>' +2080 '<identifier>x</identifier>' +2081 '<number>2</number>' +2082 '</children>' +2083 '</overscore>' +2084 '</children>' +2085 '</fenced>' +2086 '</children>' +2087 '</appl>');2088 this.executeTreeTest(2089 '<mrow><mi>f</mi><mo>(</mo><munder><mi>x</mi><mn>2</mn></munder>' +2090 '<mo>)</mo></mrow>',2091 '<appl>' +2092 '<content>' +2093 '<punctuation>\u2061</punctuation>' +2094 '</content>' +2095 '<children>' +2096 '<identifier>f</identifier>' +2097 '<fenced>' +2098 '<content>' +2099 '<fence>(</fence>' +2100 '<fence>)</fence>' +2101 '</content>' +2102 '<children>' +2103 '<underscore>' +2104 '<children>' +2105 '<identifier>x</identifier>' +2106 '<number>2</number>' +2107 '</children>' +2108 '</underscore>' +2109 '</children>' +2110 '</fenced>' +2111 '</children>' +2112 '</appl>');2113 this.executeTreeTest(2114 '<mrow><mi>f</mi><mo>(</mo><munderover><mi>x</mi><mn>2</mn>' +2115 '<mn>1</mn></munderover><mo>)</mo></mrow>',2116 '<appl>' +2117 '<content>' +2118 '<punctuation>\u2061</punctuation>' +2119 '</content>' +2120 '<children>' +2121 '<identifier>f</identifier>' +2122 '<fenced>' +2123 '<content>' +2124 '<fence>(</fence>' +2125 '<fence>)</fence>' +2126 '</content>' +2127 '<children>' +2128 '<overscore>' +2129 '<children>' +2130 '<underscore>' +2131 '<children>' +2132 '<identifier>x</identifier>' +2133 '<number>2</number>' +2134 '</children>' +2135 '</underscore>' +2136 '<number>1</number>' +2137 '</children>' +2138 '</overscore>' +2139 '</children>' +2140 '</fenced>' +2141 '</children>' +2142 '</appl>');2143 this.executeTreeTest(2144 '<mrow><mi>f</mi><mo>(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac>' +2145 '<mo>)</mo></mrow>',2146 '<appl>' +2147 '<content>' +2148 '<punctuation>\u2061</punctuation>' +2149 '</content>' +2150 '<children>' +2151 '<identifier>f</identifier>' +2152 '<fenced>' +2153 '<content>' +2154 '<fence>(</fence>' +2155 '<fence>)</fence>' +2156 '</content>' +2157 '<children>' +2158 '<fraction>' +2159 '<children>' +2160 '<number>1</number>' +2161 '<number>2</number>' +2162 '</children>' +2163 '</fraction>' +2164 '</children>' +2165 '</fenced>' +2166 '</children>' +2167 '</appl>');2168 this.executeTreeTest(2169 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +2170 '<mo>)</mo></mrow>',2171 '<infixop>\u2062' +2172 '<content>' +2173 '<operator>\u2062</operator>' +2174 '</content>' +2175 '<children>' +2176 '<identifier>f</identifier>' +2177 '<fenced>' +2178 '<content>' +2179 '<fence>(</fence>' +2180 '<fence>)</fence>' +2181 '</content>' +2182 '<children>' +2183 '<infixop>+' +2184 '<content>' +2185 '<operator>+</operator>' +2186 '</content>' +2187 '<children>' +2188 '<identifier>x</identifier>' +2189 '<identifier>y</identifier>' +2190 '</children>' +2191 '</infixop>' +2192 '</children>' +2193 '</fenced>' +2194 '</children>' +2195 '</infixop>');2196};2197/**2198 * Simple functions with surrounding operators.2199 */2200cvox.SemanticTreeTest.prototype.testStreeSimpleFuncsWithOps = function() {2201 this.brief = true;2202 this.executeTreeTest(2203 '<mrow><mn>1</mn><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi>' +2204 '<mo>)</mo></mrow>',2205 '<infixop>+' +2206 '<content>' +2207 '<operator>+</operator>' +2208 '</content>' +2209 '<children>' +2210 '<number>1</number>' +2211 '<appl>' +2212 '<content>' +2213 '<punctuation>\u2061</punctuation>' +2214 '</content>' +2215 '<children>' +2216 '<identifier>f</identifier>' +2217 '<fenced>' +2218 '<content>' +2219 '<fence>(</fence>' +2220 '<fence>)</fence>' +2221 '</content>' +2222 '<children>' +2223 '<identifier>x</identifier>' +2224 '</children>' +2225 '</fenced>' +2226 '</children>' +2227 '</appl>' +2228 '</children>' +2229 '</infixop>');2230 this.executeTreeTest(2231 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +2232 '<mn>2</mn></mrow>',2233 '<infixop>+' +2234 '<content>' +2235 '<operator>+</operator>' +2236 '</content>' +2237 '<children>' +2238 '<appl>' +2239 '<content>' +2240 '<punctuation>\u2061</punctuation>' +2241 '</content>' +2242 '<children>' +2243 '<identifier>f</identifier>' +2244 '<fenced>' +2245 '<content>' +2246 '<fence>(</fence>' +2247 '<fence>)</fence>' +2248 '</content>' +2249 '<children>' +2250 '<identifier>x</identifier>' +2251 '</children>' +2252 '</fenced>' +2253 '</children>' +2254 '</appl>' +2255 '<number>2</number>' +2256 '</children>' +2257 '</infixop>');2258 this.executeTreeTest(2259 '<mrow><mn>1</mn><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2260 '<mo>+</mo><mn>2</mn></mrow>',2261 '<infixop>+' +2262 '<content>' +2263 '<operator>+</operator>' +2264 '<operator>+</operator>' +2265 '</content>' +2266 '<children>' +2267 '<number>1</number>' +2268 '<appl>' +2269 '<content>' +2270 '<punctuation>\u2061</punctuation>' +2271 '</content>' +2272 '<children>' +2273 '<identifier>f</identifier>' +2274 '<fenced>' +2275 '<content>' +2276 '<fence>(</fence>' +2277 '<fence>)</fence>' +2278 '</content>' +2279 '<children>' +2280 '<identifier>x</identifier>' +2281 '</children>' +2282 '</fenced>' +2283 '</children>' +2284 '</appl>' +2285 '<number>2</number>' +2286 '</children>' +2287 '</infixop>');2288 this.executeTreeTest(2289 '<mrow><mo>a</mo><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi>' +2290 '<mo>)</mo></mrow>',2291 '<infixop>+' +2292 '<content>' +2293 '<operator>+</operator>' +2294 '</content>' +2295 '<children>' +2296 '<identifier>a</identifier>' +2297 '<appl>' +2298 '<content>' +2299 '<punctuation>\u2061</punctuation>' +2300 '</content>' +2301 '<children>' +2302 '<identifier>f</identifier>' +2303 '<fenced>' +2304 '<content>' +2305 '<fence>(</fence>' +2306 '<fence>)</fence>' +2307 '</content>' +2308 '<children>' +2309 '<identifier>x</identifier>' +2310 '</children>' +2311 '</fenced>' +2312 '</children>' +2313 '</appl>' +2314 '</children>' +2315 '</infixop>');2316 this.executeTreeTest(2317 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +2318 '<mo>b</mo></mrow>',2319 '<infixop>+' +2320 '<content>' +2321 '<operator>+</operator>' +2322 '</content>' +2323 '<children>' +2324 '<appl>' +2325 '<content>' +2326 '<punctuation>\u2061</punctuation>' +2327 '</content>' +2328 '<children>' +2329 '<identifier>f</identifier>' +2330 '<fenced>' +2331 '<content>' +2332 '<fence>(</fence>' +2333 '<fence>)</fence>' +2334 '</content>' +2335 '<children>' +2336 '<identifier>x</identifier>' +2337 '</children>' +2338 '</fenced>' +2339 '</children>' +2340 '</appl>' +2341 '<identifier>b</identifier>' +2342 '</children>' +2343 '</infixop>');2344 this.executeTreeTest(2345 '<mrow><mo>a</mo><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2346 '<mo>+</mo><mo>b</mo></mrow>',2347 '<infixop>+' +2348 '<content>' +2349 '<operator>+</operator>' +2350 '<operator>+</operator>' +2351 '</content>' +2352 '<children>' +2353 '<identifier>a</identifier>' +2354 '<appl>' +2355 '<content>' +2356 '<punctuation>\u2061</punctuation>' +2357 '</content>' +2358 '<children>' +2359 '<identifier>f</identifier>' +2360 '<fenced>' +2361 '<content>' +2362 '<fence>(</fence>' +2363 '<fence>)</fence>' +2364 '</content>' +2365 '<children>' +2366 '<identifier>x</identifier>' +2367 '</children>' +2368 '</fenced>' +2369 '</children>' +2370 '</appl>' +2371 '<identifier>b</identifier>' +2372 '</children>' +2373 '</infixop>');2374 this.executeTreeTest(2375 '<mrow><mo>a</mo><mo>=</mo><mi>f</mi><mo>(</mo><mi>x</mi>' +2376 '<mo>)</mo></mrow>',2377 '<relseq>=' +2378 '<content>' +2379 '<relation>=</relation>' +2380 '</content>' +2381 '<children>' +2382 '<identifier>a</identifier>' +2383 '<appl>' +2384 '<content>' +2385 '<punctuation>\u2061</punctuation>' +2386 '</content>' +2387 '<children>' +2388 '<identifier>f</identifier>' +2389 '<fenced>' +2390 '<content>' +2391 '<fence>(</fence>' +2392 '<fence>)</fence>' +2393 '</content>' +2394 '<children>' +2395 '<identifier>x</identifier>' +2396 '</children>' +2397 '</fenced>' +2398 '</children>' +2399 '</appl>' +2400 '</children>' +2401 '</relseq>');2402 this.executeTreeTest(2403 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo>' +2404 '<mo>b</mo></mrow>',2405 '<relseq>=' +2406 '<content>' +2407 '<relation>=</relation>' +2408 '</content>' +2409 '<children>' +2410 '<appl>' +2411 '<content>' +2412 '<punctuation>\u2061</punctuation>' +2413 '</content>' +2414 '<children>' +2415 '<identifier>f</identifier>' +2416 '<fenced>' +2417 '<content>' +2418 '<fence>(</fence>' +2419 '<fence>)</fence>' +2420 '</content>' +2421 '<children>' +2422 '<identifier>x</identifier>' +2423 '</children>' +2424 '</fenced>' +2425 '</children>' +2426 '</appl>' +2427 '<identifier>b</identifier>' +2428 '</children>' +2429 '</relseq>');2430 this.executeTreeTest(2431 '<mrow><mo>a</mo><mo>=</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2432 '<mo>=</mo><mo>b</mo></mrow>',2433 '<relseq>=' +2434 '<content>' +2435 '<relation>=</relation>' +2436 '<relation>=</relation>' +2437 '</content>' +2438 '<children>' +2439 '<identifier>a</identifier>' +2440 '<appl>' +2441 '<content>' +2442 '<punctuation>\u2061</punctuation>' +2443 '</content>' +2444 '<children>' +2445 '<identifier>f</identifier>' +2446 '<fenced>' +2447 '<content>' +2448 '<fence>(</fence>' +2449 '<fence>)</fence>' +2450 '</content>' +2451 '<children>' +2452 '<identifier>x</identifier>' +2453 '</children>' +2454 '</fenced>' +2455 '</children>' +2456 '</appl>' +2457 '<identifier>b</identifier>' +2458 '</children>' +2459 '</relseq>');2460};2461/**2462 * Multiple simple functions.2463 */2464cvox.SemanticTreeTest.prototype.testStreeSimpleFuncsMulti = function() {2465 this.brief = true;2466 this.executeTreeTest(2467 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>g</mi>' +2468 '<mo>(</mo><mi>x</mi><mo>)</mo></mrow>',2469 '<infixop>+' +2470 '<content>' +2471 '<operator>+</operator>' +2472 '</content>' +2473 '<children>' +2474 '<appl>' +2475 '<content>' +2476 '<punctuation>\u2061</punctuation>' +2477 '</content>' +2478 '<children>' +2479 '<identifier>f</identifier>' +2480 '<fenced>' +2481 '<content>' +2482 '<fence>(</fence>' +2483 '<fence>)</fence>' +2484 '</content>' +2485 '<children>' +2486 '<identifier>x</identifier>' +2487 '</children>' +2488 '</fenced>' +2489 '</children>' +2490 '</appl>' +2491 '<appl>' +2492 '<content>' +2493 '<punctuation>\u2061</punctuation>' +2494 '</content>' +2495 '<children>' +2496 '<identifier>g</identifier>' +2497 '<fenced>' +2498 '<content>' +2499 '<fence>(</fence>' +2500 '<fence>)</fence>' +2501 '</content>' +2502 '<children>' +2503 '<identifier>x</identifier>' +2504 '</children>' +2505 '</fenced>' +2506 '</children>' +2507 '</appl>' +2508 '</children>' +2509 '</infixop>');2510 this.executeTreeTest(2511 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>g</mi>' +2512 '<mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mi>h</mi><mo>(</mo>' +2513 '<mi>x</mi><mo>)</mo></mrow>',2514 '<relseq>=' +2515 '<content>' +2516 '<relation>=</relation>' +2517 '</content>' +2518 '<children>' +2519 '<infixop>+' +2520 '<content>' +2521 '<operator>+</operator>' +2522 '</content>' +2523 '<children>' +2524 '<appl>' +2525 '<content>' +2526 '<punctuation>\u2061</punctuation>' +2527 '</content>' +2528 '<children>' +2529 '<identifier>f</identifier>' +2530 '<fenced>' +2531 '<content>' +2532 '<fence>(</fence>' +2533 '<fence>)</fence>' +2534 '</content>' +2535 '<children>' +2536 '<identifier>x</identifier>' +2537 '</children>' +2538 '</fenced>' +2539 '</children>' +2540 '</appl>' +2541 '<appl>' +2542 '<content>' +2543 '<punctuation>\u2061</punctuation>' +2544 '</content>' +2545 '<children>' +2546 '<identifier>g</identifier>' +2547 '<fenced>' +2548 '<content>' +2549 '<fence>(</fence>' +2550 '<fence>)</fence>' +2551 '</content>' +2552 '<children>' +2553 '<identifier>x</identifier>' +2554 '</children>' +2555 '</fenced>' +2556 '</children>' +2557 '</appl>' +2558 '</children>' +2559 '</infixop>' +2560 '<appl>' +2561 '<content>' +2562 '<punctuation>\u2061</punctuation>' +2563 '</content>' +2564 '<children>' +2565 '<identifier>h</identifier>' +2566 '<fenced>' +2567 '<content>' +2568 '<fence>(</fence>' +2569 '<fence>)</fence>' +2570 '</content>' +2571 '<children>' +2572 '<identifier>x</identifier>' +2573 '</children>' +2574 '</fenced>' +2575 '</children>' +2576 '</appl>' +2577 '</children>' +2578 '</relseq>');2579 this.executeTreeTest(2580 '<mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>g</mi>' +2581 '<mo>(</mo><mi>y</mi><mo>)</mo><mo>=</mo><mi>h</mi><mo>(</mo>' +2582 '<mi>x</mi><mi>y</mi><mo>)</mo></mrow>',2583 '<relseq>=' +2584 '<content>' +2585 '<relation>=</relation>' +2586 '</content>' +2587 '<children>' +2588 '<infixop>+' +2589 '<content>' +2590 '<operator>+</operator>' +2591 '</content>' +2592 '<children>' +2593 '<appl>' +2594 '<content>' +2595 '<punctuation>\u2061</punctuation>' +2596 '</content>' +2597 '<children>' +2598 '<identifier>f</identifier>' +2599 '<fenced>' +2600 '<content>' +2601 '<fence>(</fence>' +2602 '<fence>)</fence>' +2603 '</content>' +2604 '<children>' +2605 '<identifier>x</identifier>' +2606 '</children>' +2607 '</fenced>' +2608 '</children>' +2609 '</appl>' +2610 '<appl>' +2611 '<content>' +2612 '<punctuation>\u2061</punctuation>' +2613 '</content>' +2614 '<children>' +2615 '<identifier>g</identifier>' +2616 '<fenced>' +2617 '<content>' +2618 '<fence>(</fence>' +2619 '<fence>)</fence>' +2620 '</content>' +2621 '<children>' +2622 '<identifier>y</identifier>' +2623 '</children>' +2624 '</fenced>' +2625 '</children>' +2626 '</appl>' +2627 '</children>' +2628 '</infixop>' +2629 '<appl>' +2630 '<content>' +2631 '<punctuation>\u2061</punctuation>' +2632 '</content>' +2633 '<children>' +2634 '<identifier>h</identifier>' +2635 '<fenced>' +2636 '<content>' +2637 '<fence>(</fence>' +2638 '<fence>)</fence>' +2639 '</content>' +2640 '<children>' +2641 '<infixop>\u2062' +2642 '<content>' +2643 '<operator>\u2062</operator>' +2644 '</content>' +2645 '<children>' +2646 '<identifier>x</identifier>' +2647 '<identifier>y</identifier>' +2648 '</children>' +2649 '</infixop>' +2650 '</children>' +2651 '</fenced>' +2652 '</children>' +2653 '</appl>' +2654 '</children>' +2655 '</relseq>');2656};2657/**2658 * Nested simple functions.2659 */2660cvox.SemanticTreeTest.prototype.testStreeSimpleFuncsNested = function() {2661 this.brief = true;2662 this.executeTreeTest(2663 '<mrow><mi>g</mi><mo>(</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2664 '<mo>)</mo></mrow>',2665 '<appl>' +2666 '<content>' +2667 '<punctuation>\u2061</punctuation>' +2668 '</content>' +2669 '<children>' +2670 '<identifier>g</identifier>' +2671 '<fenced>' +2672 '<content>' +2673 '<fence>(</fence>' +2674 '<fence>)</fence>' +2675 '</content>' +2676 '<children>' +2677 '<appl>' +2678 '<content>' +2679 '<punctuation>\u2061</punctuation>' +2680 '</content>' +2681 '<children>' +2682 '<identifier>f</identifier>' +2683 '<fenced>' +2684 '<content>' +2685 '<fence>(</fence>' +2686 '<fence>)</fence>' +2687 '</content>' +2688 '<children>' +2689 '<identifier>x</identifier>' +2690 '</children>' +2691 '</fenced>' +2692 '</children>' +2693 '</appl>' +2694 '</children>' +2695 '</fenced>' +2696 '</children>' +2697 '</appl>');2698 this.executeTreeTest(2699 '<mrow><mi>h</mi><mo>(</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2700 '<mi>g</mi><mo>(</mo><mi>y</mi><mo>)</mo><mo>)</mo></mrow>',2701 '<appl>' +2702 '<content>' +2703 '<punctuation>\u2061</punctuation>' +2704 '</content>' +2705 '<children>' +2706 '<identifier>h</identifier>' +2707 '<fenced>' +2708 '<content>' +2709 '<fence>(</fence>' +2710 '<fence>)</fence>' +2711 '</content>' +2712 '<children>' +2713 '<infixop>\u2062' +2714 '<content>' +2715 '<operator>\u2062</operator>' +2716 '</content>' +2717 '<children>' +2718 '<appl>' +2719 '<content>' +2720 '<punctuation>\u2061</punctuation>' +2721 '</content>' +2722 '<children>' +2723 '<identifier>f</identifier>' +2724 '<fenced>' +2725 '<content>' +2726 '<fence>(</fence>' +2727 '<fence>)</fence>' +2728 '</content>' +2729 '<children>' +2730 '<identifier>x</identifier>' +2731 '</children>' +2732 '</fenced>' +2733 '</children>' +2734 '</appl>' +2735 '<appl>' +2736 '<content>' +2737 '<punctuation>\u2061</punctuation>' +2738 '</content>' +2739 '<children>' +2740 '<identifier>g</identifier>' +2741 '<fenced>' +2742 '<content>' +2743 '<fence>(</fence>' +2744 '<fence>)</fence>' +2745 '</content>' +2746 '<children>' +2747 '<identifier>y</identifier>' +2748 '</children>' +2749 '</fenced>' +2750 '</children>' +2751 '</appl>' +2752 '</children>' +2753 '</infixop>' +2754 '</children>' +2755 '</fenced>' +2756 '</children>' +2757 '</appl>');2758 this.executeTreeTest(2759 '<mrow><mi>h</mi><mo>(</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +2760 '<mo>+</mo><mi>g</mi><mo>(</mo><mi>y</mi><mo>)</mo><mo>)</mo></mrow>',2761 '<infixop>\u2062' +2762 '<content>' +2763 '<operator>\u2062</operator>' +2764 '</content>' +2765 '<children>' +2766 '<identifier>h</identifier>' +2767 '<fenced>' +2768 '<content>' +2769 '<fence>(</fence>' +2770 '<fence>)</fence>' +2771 '</content>' +2772 '<children>' +2773 '<infixop>+' +2774 '<content>' +2775 '<operator>+</operator>' +2776 '</content>' +2777 '<children>' +2778 '<appl>' +2779 '<content>' +2780 '<punctuation>\u2061</punctuation>' +2781 '</content>' +2782 '<children>' +2783 '<identifier>f</identifier>' +2784 '<fenced>' +2785 '<content>' +2786 '<fence>(</fence>' +2787 '<fence>)</fence>' +2788 '</content>' +2789 '<children>' +2790 '<identifier>x</identifier>' +2791 '</children>' +2792 '</fenced>' +2793 '</children>' +2794 '</appl>' +2795 '<appl>' +2796 '<content>' +2797 '<punctuation>\u2061</punctuation>' +2798 '</content>' +2799 '<children>' +2800 '<identifier>g</identifier>' +2801 '<fenced>' +2802 '<content>' +2803 '<fence>(</fence>' +2804 '<fence>)</fence>' +2805 '</content>' +2806 '<children>' +2807 '<identifier>y</identifier>' +2808 '</children>' +2809 '</fenced>' +2810 '</children>' +2811 '</appl>' +2812 '</children>' +2813 '</infixop>' +2814 '</children>' +2815 '</fenced>' +2816 '</children>' +2817 '</infixop>');2818 this.executeTreeTest(2819 '<mi>P</mi><mo>[</mo><mi>x</mi><mo>=</mo><mn>2</mn><mo>]</mo>',2820 '<appl>' +2821 '<content>' +2822 '<punctuation>\u2061</punctuation>' +2823 '</content>' +2824 '<children>' +2825 '<identifier>P</identifier>' +2826 '<fenced>' +2827 '<content>' +2828 '<fence>[</fence>' +2829 '<fence>]</fence>' +2830 '</content>' +2831 '<children>' +2832 '<relseq>=' +2833 '<content>' +2834 '<relation>=</relation>' +2835 '</content>' +2836 '<children>' +2837 '<identifier>x</identifier>' +2838 '<number>2</number>' +2839 '</children>' +2840 '</relseq>' +2841 '</children>' +2842 '</fenced>' +2843 '</children>' +2844 '</appl>');2845};2846/**2847 * Simple functions with explicit function application.2848 */2849cvox.SemanticTreeTest.prototype.testStreeSimpleFuncsExplicitApp = function() {2850 this.brief = true;2851 this.executeTreeTest(2852 '<mi>f</mi><mo>\u2061</mo><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +2853 '<mo>)</mo>',2854 '<appl>' +2855 '<content>' +2856 '<punctuation>\u2061</punctuation>' +2857 '</content>' +2858 '<children>' +2859 '<identifier>f</identifier>' +2860 '<fenced>' +2861 '<content>' +2862 '<fence>(</fence>' +2863 '<fence>)</fence>' +2864 '</content>' +2865 '<children>' +2866 '<infixop>+' +2867 '<content>' +2868 '<operator>+</operator>' +2869 '</content>' +2870 '<children>' +2871 '<identifier>x</identifier>' +2872 '<identifier>y</identifier>' +2873 '</children>' +2874 '</infixop>' +2875 '</children>' +2876 '</fenced>' +2877 '</children>' +2878 '</appl>');2879 this.executeTreeTest(2880 '<mi>f</mi><mo>\u2061</mo><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +2881 '<mo>)</mo><mo>+</mo><mi>f</mi><mo>(</mo><mi>x</mi><mo>+</mo>' +2882 '<mi>y</mi><mo>)</mo>',2883 '<infixop>+' +2884 '<content>' +2885 '<operator>+</operator>' +2886 '</content>' +2887 '<children>' +2888 '<appl>' +2889 '<content>' +2890 '<punctuation>\u2061</punctuation>' +2891 '</content>' +2892 '<children>' +2893 '<identifier>f</identifier>' +2894 '<fenced>' +2895 '<content>' +2896 '<fence>(</fence>' +2897 '<fence>)</fence>' +2898 '</content>' +2899 '<children>' +2900 '<infixop>+' +2901 '<content>' +2902 '<operator>+</operator>' +2903 '</content>' +2904 '<children>' +2905 '<identifier>x</identifier>' +2906 '<identifier>y</identifier>' +2907 '</children>' +2908 '</infixop>' +2909 '</children>' +2910 '</fenced>' +2911 '</children>' +2912 '</appl>' +2913 '<infixop>\u2062' +2914 '<content>' +2915 '<operator>\u2062</operator>' +2916 '</content>' +2917 '<children>' +2918 '<identifier>f</identifier>' +2919 '<fenced>' +2920 '<content>' +2921 '<fence>(</fence>' +2922 '<fence>)</fence>' +2923 '</content>' +2924 '<children>' +2925 '<infixop>+' +2926 '<content>' +2927 '<operator>+</operator>' +2928 '</content>' +2929 '<children>' +2930 '<identifier>x</identifier>' +2931 '<identifier>y</identifier>' +2932 '</children>' +2933 '</infixop>' +2934 '</children>' +2935 '</fenced>' +2936 '</children>' +2937 '</infixop>' +2938 '</children>' +2939 '</infixop>');2940 this.executeTreeTest(2941 '<msub><mi>f</mi><mn>1</mn></msub><mo>\u2061</mo><mo>(</mo><mi>x</mi>' +2942 '<mo>+</mo><mi>y</mi><mo>)</mo>',2943 '<appl>' +2944 '<content>' +2945 '<punctuation>\u2061</punctuation>' +2946 '</content>' +2947 '<children>' +2948 '<subscript>' +2949 '<children>' +2950 '<identifier>f</identifier>' +2951 '<number>1</number>' +2952 '</children>' +2953 '</subscript>' +2954 '<fenced>' +2955 '<content>' +2956 '<fence>(</fence>' +2957 '<fence>)</fence>' +2958 '</content>' +2959 '<children>' +2960 '<infixop>+' +2961 '<content>' +2962 '<operator>+</operator>' +2963 '</content>' +2964 '<children>' +2965 '<identifier>x</identifier>' +2966 '<identifier>y</identifier>' +2967 '</children>' +2968 '</infixop>' +2969 '</children>' +2970 '</fenced>' +2971 '</children>' +2972 '</appl>');2973 this.executeTreeTest(2974 '<msup><msub><mi>f</mi><mn>n</mn></msub><mn>2</mn></msup>' +2975 '<mo>\u2061</mo><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo>' +2976 '<mo>+</mo><msup><msub><mi>f</mi><mn>m</mn></msub><mn>2</mn></msup>' +2977 '<mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>)</mo>',2978 '<infixop>+' +2979 '<content>' +2980 '<operator>+</operator>' +2981 '</content>' +2982 '<children>' +2983 '<appl>' +2984 '<content>' +2985 '<punctuation>\u2061</punctuation>' +2986 '</content>' +2987 '<children>' +2988 '<superscript>' +2989 '<children>' +2990 '<subscript>' +2991 '<children>' +2992 '<identifier>f</identifier>' +2993 '<identifier>n</identifier>' +2994 '</children>' +2995 '</subscript>' +2996 '<number>2</number>' +2997 '</children>' +2998 '</superscript>' +2999 '<fenced>' +3000 '<content>' +3001 '<fence>(</fence>' +3002 '<fence>)</fence>' +3003 '</content>' +3004 '<children>' +3005 '<infixop>+' +3006 '<content>' +3007 '<operator>+</operator>' +3008 '</content>' +3009 '<children>' +3010 '<identifier>x</identifier>' +3011 '<identifier>y</identifier>' +3012 '</children>' +3013 '</infixop>' +3014 '</children>' +3015 '</fenced>' +3016 '</children>' +3017 '</appl>' +3018 '<infixop>\u2062' +3019 '<content>' +3020 '<operator>\u2062</operator>' +3021 '</content>' +3022 '<children>' +3023 '<superscript>' +3024 '<children>' +3025 '<subscript>' +3026 '<children>' +3027 '<identifier>f</identifier>' +3028 '<identifier>m</identifier>' +3029 '</children>' +3030 '</subscript>' +3031 '<number>2</number>' +3032 '</children>' +3033 '</superscript>' +3034 '<fenced>' +3035 '<content>' +3036 '<fence>(</fence>' +3037 '<fence>)</fence>' +3038 '</content>' +3039 '<children>' +3040 '<infixop>+' +3041 '<content>' +3042 '<operator>+</operator>' +3043 '</content>' +3044 '<children>' +3045 '<identifier>x</identifier>' +3046 '<identifier>y</identifier>' +3047 '</children>' +3048 '</infixop>' +3049 '</children>' +3050 '</fenced>' +3051 '</children>' +3052 '</infixop>' +3053 '</children>' +3054 '</infixop>');3055};3056/**3057 * Prefix function applications3058 */3059cvox.SemanticTreeTest.prototype.testStreePrefixFuncsSingle = function() {3060 this.brief = true;3061 this.executeTreeTest(3062 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow>',3063 '<appl>' +3064 '<content>' +3065 '<punctuation>\u2061</punctuation>' +3066 '</content>' +3067 '<children>' +3068 '<function>sin</function>' +3069 '<fenced>' +3070 '<content>' +3071 '<fence>(</fence>' +3072 '<fence>)</fence>' +3073 '</content>' +3074 '<children>' +3075 '<identifier>x</identifier>' +3076 '</children>' +3077 '</fenced>' +3078 '</children>' +3079 '</appl>');3080 this.executeTreeTest(3081 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mi>y</mi><mo>)</mo></mrow>',3082 '<appl>' +3083 '<content>' +3084 '<punctuation>\u2061</punctuation>' +3085 '</content>' +3086 '<children>' +3087 '<function>sin</function>' +3088 '<fenced>' +3089 '<content>' +3090 '<fence>(</fence>' +3091 '<fence>)</fence>' +3092 '</content>' +3093 '<children>' +3094 '<infixop>\u2062' +3095 '<content>' +3096 '<operator>\u2062</operator>' +3097 '</content>' +3098 '<children>' +3099 '<identifier>x</identifier>' +3100 '<identifier>y</identifier>' +3101 '</children>' +3102 '</infixop>' +3103 '</children>' +3104 '</fenced>' +3105 '</children>' +3106 '</appl>');3107 this.executeTreeTest(3108 '<mrow><mi>sin</mi><mo>(</mo><msup><mi>x</mi><mn>2</mn></msup>' +3109 '<mo>)</mo></mrow>',3110 '<appl>' +3111 '<content>' +3112 '<punctuation>\u2061</punctuation>' +3113 '</content>' +3114 '<children>' +3115 '<function>sin</function>' +3116 '<fenced>' +3117 '<content>' +3118 '<fence>(</fence>' +3119 '<fence>)</fence>' +3120 '</content>' +3121 '<children>' +3122 '<superscript>' +3123 '<children>' +3124 '<identifier>x</identifier>' +3125 '<number>2</number>' +3126 '</children>' +3127 '</superscript>' +3128 '</children>' +3129 '</fenced>' +3130 '</children>' +3131 '</appl>');3132 this.executeTreeTest(3133 '<mrow><mi>sin</mi><mo>(</mo><msub><mi>x</mi><mn>2</mn></msub>' +3134 '<mo>)</mo></mrow>',3135 '<appl>' +3136 '<content>' +3137 '<punctuation>\u2061</punctuation>' +3138 '</content>' +3139 '<children>' +3140 '<function>sin</function>' +3141 '<fenced>' +3142 '<content>' +3143 '<fence>(</fence>' +3144 '<fence>)</fence>' +3145 '</content>' +3146 '<children>' +3147 '<subscript>' +3148 '<children>' +3149 '<identifier>x</identifier>' +3150 '<number>2</number>' +3151 '</children>' +3152 '</subscript>' +3153 '</children>' +3154 '</fenced>' +3155 '</children>' +3156 '</appl>');3157 this.executeTreeTest(3158 '<mrow><mi>sin</mi><mo>(</mo><msubsup><mi>x</mi><mn>2</mn>' +3159 '<mn>1</mn></msubsup><mo>)</mo></mrow>',3160 '<appl>' +3161 '<content>' +3162 '<punctuation>\u2061</punctuation>' +3163 '</content>' +3164 '<children>' +3165 '<function>sin</function>' +3166 '<fenced>' +3167 '<content>' +3168 '<fence>(</fence>' +3169 '<fence>)</fence>' +3170 '</content>' +3171 '<children>' +3172 '<superscript>' +3173 '<children>' +3174 '<subscript>' +3175 '<children>' +3176 '<identifier>x</identifier>' +3177 '<number>2</number>' +3178 '</children>' +3179 '</subscript>' +3180 '<number>1</number>' +3181 '</children>' +3182 '</superscript>' +3183 '</children>' +3184 '</fenced>' +3185 '</children>' +3186 '</appl>');3187 this.executeTreeTest(3188 '<mrow><mi>sin</mi><mo>(</mo><mover><mi>x</mi><mn>2</mn></mover>' +3189 '<mo>)</mo></mrow>',3190 '<appl>' +3191 '<content>' +3192 '<punctuation>\u2061</punctuation>' +3193 '</content>' +3194 '<children>' +3195 '<function>sin</function>' +3196 '<fenced>' +3197 '<content>' +3198 '<fence>(</fence>' +3199 '<fence>)</fence>' +3200 '</content>' +3201 '<children>' +3202 '<overscore>' +3203 '<children>' +3204 '<identifier>x</identifier>' +3205 '<number>2</number>' +3206 '</children>' +3207 '</overscore>' +3208 '</children>' +3209 '</fenced>' +3210 '</children>' +3211 '</appl>');3212 this.executeTreeTest(3213 '<mrow><mi>sin</mi><mo>(</mo><munder><mi>x</mi><mn>2</mn></munder>' +3214 '<mo>)</mo></mrow>',3215 '<appl>' +3216 '<content>' +3217 '<punctuation>\u2061</punctuation>' +3218 '</content>' +3219 '<children>' +3220 '<function>sin</function>' +3221 '<fenced>' +3222 '<content>' +3223 '<fence>(</fence>' +3224 '<fence>)</fence>' +3225 '</content>' +3226 '<children>' +3227 '<underscore>' +3228 '<children>' +3229 '<identifier>x</identifier>' +3230 '<number>2</number>' +3231 '</children>' +3232 '</underscore>' +3233 '</children>' +3234 '</fenced>' +3235 '</children>' +3236 '</appl>');3237 this.executeTreeTest(3238 '<mrow><mi>sin</mi><mo>(</mo><munderover><mi>x</mi><mn>2</mn>' +3239 '<mn>1</mn></munderover><mo>)</mo></mrow>',3240 '<appl>' +3241 '<content>' +3242 '<punctuation>\u2061</punctuation>' +3243 '</content>' +3244 '<children>' +3245 '<function>sin</function>' +3246 '<fenced>' +3247 '<content>' +3248 '<fence>(</fence>' +3249 '<fence>)</fence>' +3250 '</content>' +3251 '<children>' +3252 '<overscore>' +3253 '<children>' +3254 '<underscore>' +3255 '<children>' +3256 '<identifier>x</identifier>' +3257 '<number>2</number>' +3258 '</children>' +3259 '</underscore>' +3260 '<number>1</number>' +3261 '</children>' +3262 '</overscore>' +3263 '</children>' +3264 '</fenced>' +3265 '</children>' +3266 '</appl>');3267 this.executeTreeTest(3268 '<mrow><mi>sin</mi><mo>(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac>' +3269 '<mo>)</mo></mrow>',3270 '<appl>' +3271 '<content>' +3272 '<punctuation>\u2061</punctuation>' +3273 '</content>' +3274 '<children>' +3275 '<function>sin</function>' +3276 '<fenced>' +3277 '<content>' +3278 '<fence>(</fence>' +3279 '<fence>)</fence>' +3280 '</content>' +3281 '<children>' +3282 '<fraction>' +3283 '<children>' +3284 '<number>1</number>' +3285 '<number>2</number>' +3286 '</children>' +3287 '</fraction>' +3288 '</children>' +3289 '</fenced>' +3290 '</children>' +3291 '</appl>');3292 this.executeTreeTest(3293 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>+</mo><mi>y</mi>' +3294 '<mo>)</mo></mrow>',3295 '<appl>' +3296 '<content>' +3297 '<punctuation>\u2061</punctuation>' +3298 '</content>' +3299 '<children>' +3300 '<function>sin</function>' +3301 '<fenced>' +3302 '<content>' +3303 '<fence>(</fence>' +3304 '<fence>)</fence>' +3305 '</content>' +3306 '<children>' +3307 '<infixop>+' +3308 '<content>' +3309 '<operator>+</operator>' +3310 '</content>' +3311 '<children>' +3312 '<identifier>x</identifier>' +3313 '<identifier>y</identifier>' +3314 '</children>' +3315 '</infixop>' +3316 '</children>' +3317 '</fenced>' +3318 '</children>' +3319 '</appl>');3320};3321/**3322 * Prefix functions applications with surrounding operators.3323 */3324cvox.SemanticTreeTest.prototype.testStreePrefixFuncsWithOps = function() {3325 this.brief = true;3326 this.executeTreeTest(3327 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3328 '<mo>)</mo></mrow>',3329 '<infixop>+' +3330 '<content>' +3331 '<operator>+</operator>' +3332 '</content>' +3333 '<children>' +3334 '<number>1</number>' +3335 '<appl>' +3336 '<content>' +3337 '<punctuation>\u2061</punctuation>' +3338 '</content>' +3339 '<children>' +3340 '<function>sin</function>' +3341 '<fenced>' +3342 '<content>' +3343 '<fence>(</fence>' +3344 '<fence>)</fence>' +3345 '</content>' +3346 '<children>' +3347 '<identifier>x</identifier>' +3348 '</children>' +3349 '</fenced>' +3350 '</children>' +3351 '</appl>' +3352 '</children>' +3353 '</infixop>');3354 this.executeTreeTest(3355 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +3356 '<mn>2</mn></mrow>',3357 '<infixop>+' +3358 '<content>' +3359 '<operator>+</operator>' +3360 '</content>' +3361 '<children>' +3362 '<appl>' +3363 '<content>' +3364 '<punctuation>\u2061</punctuation>' +3365 '</content>' +3366 '<children>' +3367 '<function>sin</function>' +3368 '<fenced>' +3369 '<content>' +3370 '<fence>(</fence>' +3371 '<fence>)</fence>' +3372 '</content>' +3373 '<children>' +3374 '<identifier>x</identifier>' +3375 '</children>' +3376 '</fenced>' +3377 '</children>' +3378 '</appl>' +3379 '<number>2</number>' +3380 '</children>' +3381 '</infixop>');3382 this.executeTreeTest(3383 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +3384 '<mo>+</mo><mn>2</mn></mrow>',3385 '<infixop>+' +3386 '<content>' +3387 '<operator>+</operator>' +3388 '<operator>+</operator>' +3389 '</content>' +3390 '<children>' +3391 '<number>1</number>' +3392 '<appl>' +3393 '<content>' +3394 '<punctuation>\u2061</punctuation>' +3395 '</content>' +3396 '<children>' +3397 '<function>sin</function>' +3398 '<fenced>' +3399 '<content>' +3400 '<fence>(</fence>' +3401 '<fence>)</fence>' +3402 '</content>' +3403 '<children>' +3404 '<identifier>x</identifier>' +3405 '</children>' +3406 '</fenced>' +3407 '</children>' +3408 '</appl>' +3409 '<number>2</number>' +3410 '</children>' +3411 '</infixop>');3412 this.executeTreeTest(3413 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3414 '<mo>)</mo></mrow>',3415 '<infixop>+' +3416 '<content>' +3417 '<operator>+</operator>' +3418 '</content>' +3419 '<children>' +3420 '<identifier>a</identifier>' +3421 '<appl>' +3422 '<content>' +3423 '<punctuation>\u2061</punctuation>' +3424 '</content>' +3425 '<children>' +3426 '<function>sin</function>' +3427 '<fenced>' +3428 '<content>' +3429 '<fence>(</fence>' +3430 '<fence>)</fence>' +3431 '</content>' +3432 '<children>' +3433 '<identifier>x</identifier>' +3434 '</children>' +3435 '</fenced>' +3436 '</children>' +3437 '</appl>' +3438 '</children>' +3439 '</infixop>');3440 this.executeTreeTest(3441 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo>' +3442 '<mo>b</mo></mrow>',3443 '<infixop>+' +3444 '<content>' +3445 '<operator>+</operator>' +3446 '</content>' +3447 '<children>' +3448 '<appl>' +3449 '<content>' +3450 '<punctuation>\u2061</punctuation>' +3451 '</content>' +3452 '<children>' +3453 '<function>sin</function>' +3454 '<fenced>' +3455 '<content>' +3456 '<fence>(</fence>' +3457 '<fence>)</fence>' +3458 '</content>' +3459 '<children>' +3460 '<identifier>x</identifier>' +3461 '</children>' +3462 '</fenced>' +3463 '</children>' +3464 '</appl>' +3465 '<identifier>b</identifier>' +3466 '</children>' +3467 '</infixop>');3468 this.executeTreeTest(3469 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3470 '<mo>)</mo><mo>+</mo><mo>b</mo></mrow>',3471 '<infixop>+' +3472 '<content>' +3473 '<operator>+</operator>' +3474 '<operator>+</operator>' +3475 '</content>' +3476 '<children>' +3477 '<identifier>a</identifier>' +3478 '<appl>' +3479 '<content>' +3480 '<punctuation>\u2061</punctuation>' +3481 '</content>' +3482 '<children>' +3483 '<function>sin</function>' +3484 '<fenced>' +3485 '<content>' +3486 '<fence>(</fence>' +3487 '<fence>)</fence>' +3488 '</content>' +3489 '<children>' +3490 '<identifier>x</identifier>' +3491 '</children>' +3492 '</fenced>' +3493 '</children>' +3494 '</appl>' +3495 '<identifier>b</identifier>' +3496 '</children>' +3497 '</infixop>');3498 this.executeTreeTest(3499 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mo>(</mo><mi>x</mi>' +3500 '<mo>)</mo></mrow>',3501 '<relseq>=' +3502 '<content>' +3503 '<relation>=</relation>' +3504 '</content>' +3505 '<children>' +3506 '<identifier>a</identifier>' +3507 '<appl>' +3508 '<content>' +3509 '<punctuation>\u2061</punctuation>' +3510 '</content>' +3511 '<children>' +3512 '<function>sin</function>' +3513 '<fenced>' +3514 '<content>' +3515 '<fence>(</fence>' +3516 '<fence>)</fence>' +3517 '</content>' +3518 '<children>' +3519 '<identifier>x</identifier>' +3520 '</children>' +3521 '</fenced>' +3522 '</children>' +3523 '</appl>' +3524 '</children>' +3525 '</relseq>');3526 this.executeTreeTest(3527 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo>' +3528 '<mo>b</mo></mrow>',3529 '<relseq>=' +3530 '<content>' +3531 '<relation>=</relation>' +3532 '</content>' +3533 '<children>' +3534 '<appl>' +3535 '<content>' +3536 '<punctuation>\u2061</punctuation>' +3537 '</content>' +3538 '<children>' +3539 '<function>sin</function>' +3540 '<fenced>' +3541 '<content>' +3542 '<fence>(</fence>' +3543 '<fence>)</fence>' +3544 '</content>' +3545 '<children>' +3546 '<identifier>x</identifier>' +3547 '</children>' +3548 '</fenced>' +3549 '</children>' +3550 '</appl>' +3551 '<identifier>b</identifier>' +3552 '</children>' +3553 '</relseq>');3554 this.executeTreeTest(3555 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo>' +3556 '<mo>=</mo><mo>b</mo></mrow>',3557 '<relseq>=' +3558 '<content>' +3559 '<relation>=</relation>' +3560 '<relation>=</relation>' +3561 '</content>' +3562 '<children>' +3563 '<identifier>a</identifier>' +3564 '<appl>' +3565 '<content>' +3566 '<punctuation>\u2061</punctuation>' +3567 '</content>' +3568 '<children>' +3569 '<function>sin</function>' +3570 '<fenced>' +3571 '<content>' +3572 '<fence>(</fence>' +3573 '<fence>)</fence>' +3574 '</content>' +3575 '<children>' +3576 '<identifier>x</identifier>' +3577 '</children>' +3578 '</fenced>' +3579 '</children>' +3580 '</appl>' +3581 '<identifier>b</identifier>' +3582 '</children>' +3583 '</relseq>');3584};3585/**3586 * Multiple prefix function applications.3587 */3588cvox.SemanticTreeTest.prototype.testStreePrefixFuncsMulti = function() {3589 this.brief = true;3590 this.executeTreeTest(3591 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>cos</mi>' +3592 '<mo>(</mo><mi>x</mi><mo>)</mo></mrow>',3593 '<infixop>+' +3594 '<content>' +3595 '<operator>+</operator>' +3596 '</content>' +3597 '<children>' +3598 '<appl>' +3599 '<content>' +3600 '<punctuation>\u2061</punctuation>' +3601 '</content>' +3602 '<children>' +3603 '<function>sin</function>' +3604 '<fenced>' +3605 '<content>' +3606 '<fence>(</fence>' +3607 '<fence>)</fence>' +3608 '</content>' +3609 '<children>' +3610 '<identifier>x</identifier>' +3611 '</children>' +3612 '</fenced>' +3613 '</children>' +3614 '</appl>' +3615 '<appl>' +3616 '<content>' +3617 '<punctuation>\u2061</punctuation>' +3618 '</content>' +3619 '<children>' +3620 '<function>cos</function>' +3621 '<fenced>' +3622 '<content>' +3623 '<fence>(</fence>' +3624 '<fence>)</fence>' +3625 '</content>' +3626 '<children>' +3627 '<identifier>x</identifier>' +3628 '</children>' +3629 '</fenced>' +3630 '</children>' +3631 '</appl>' +3632 '</children>' +3633 '</infixop>');3634 this.executeTreeTest(3635 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>cos</mi>' +3636 '<mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mi>tan</mi><mo>(</mo>' +3637 '<mi>x</mi><mo>)</mo></mrow>',3638 '<relseq>=' +3639 '<content>' +3640 '<relation>=</relation>' +3641 '</content>' +3642 '<children>' +3643 '<infixop>+' +3644 '<content>' +3645 '<operator>+</operator>' +3646 '</content>' +3647 '<children>' +3648 '<appl>' +3649 '<content>' +3650 '<punctuation>\u2061</punctuation>' +3651 '</content>' +3652 '<children>' +3653 '<function>sin</function>' +3654 '<fenced>' +3655 '<content>' +3656 '<fence>(</fence>' +3657 '<fence>)</fence>' +3658 '</content>' +3659 '<children>' +3660 '<identifier>x</identifier>' +3661 '</children>' +3662 '</fenced>' +3663 '</children>' +3664 '</appl>' +3665 '<appl>' +3666 '<content>' +3667 '<punctuation>\u2061</punctuation>' +3668 '</content>' +3669 '<children>' +3670 '<function>cos</function>' +3671 '<fenced>' +3672 '<content>' +3673 '<fence>(</fence>' +3674 '<fence>)</fence>' +3675 '</content>' +3676 '<children>' +3677 '<identifier>x</identifier>' +3678 '</children>' +3679 '</fenced>' +3680 '</children>' +3681 '</appl>' +3682 '</children>' +3683 '</infixop>' +3684 '<appl>' +3685 '<content>' +3686 '<punctuation>\u2061</punctuation>' +3687 '</content>' +3688 '<children>' +3689 '<function>tan</function>' +3690 '<fenced>' +3691 '<content>' +3692 '<fence>(</fence>' +3693 '<fence>)</fence>' +3694 '</content>' +3695 '<children>' +3696 '<identifier>x</identifier>' +3697 '</children>' +3698 '</fenced>' +3699 '</children>' +3700 '</appl>' +3701 '</children>' +3702 '</relseq>');3703 this.executeTreeTest(3704 '<mrow><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>+</mo><mi>cos</mi>' +3705 '<mo>(</mo><mi>y</mi><mo>)</mo><mo>=</mo><mi>tan</mi><mo>(</mo>' +3706 '<mi>x</mi><mi>y</mi><mo>)</mo></mrow>',3707 '<relseq>=' +3708 '<content>' +3709 '<relation>=</relation>' +3710 '</content>' +3711 '<children>' +3712 '<infixop>+' +3713 '<content>' +3714 '<operator>+</operator>' +3715 '</content>' +3716 '<children>' +3717 '<appl>' +3718 '<content>' +3719 '<punctuation>\u2061</punctuation>' +3720 '</content>' +3721 '<children>' +3722 '<function>sin</function>' +3723 '<fenced>' +3724 '<content>' +3725 '<fence>(</fence>' +3726 '<fence>)</fence>' +3727 '</content>' +3728 '<children>' +3729 '<identifier>x</identifier>' +3730 '</children>' +3731 '</fenced>' +3732 '</children>' +3733 '</appl>' +3734 '<appl>' +3735 '<content>' +3736 '<punctuation>\u2061</punctuation>' +3737 '</content>' +3738 '<children>' +3739 '<function>cos</function>' +3740 '<fenced>' +3741 '<content>' +3742 '<fence>(</fence>' +3743 '<fence>)</fence>' +3744 '</content>' +3745 '<children>' +3746 '<identifier>y</identifier>' +3747 '</children>' +3748 '</fenced>' +3749 '</children>' +3750 '</appl>' +3751 '</children>' +3752 '</infixop>' +3753 '<appl>' +3754 '<content>' +3755 '<punctuation>\u2061</punctuation>' +3756 '</content>' +3757 '<children>' +3758 '<function>tan</function>' +3759 '<fenced>' +3760 '<content>' +3761 '<fence>(</fence>' +3762 '<fence>)</fence>' +3763 '</content>' +3764 '<children>' +3765 '<infixop>\u2062' +3766 '<content>' +3767 '<operator>\u2062</operator>' +3768 '</content>' +3769 '<children>' +3770 '<identifier>x</identifier>' +3771 '<identifier>y</identifier>' +3772 '</children>' +3773 '</infixop>' +3774 '</children>' +3775 '</fenced>' +3776 '</children>' +3777 '</appl>' +3778 '</children>' +3779 '</relseq>');3780};3781/**3782 * Prefix function applications with sub- and superscripts.3783 */3784cvox.SemanticTreeTest.prototype.testStreePrefixFuncsScripts = function() {3785 this.brief = true;3786 this.executeTreeTest(3787 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mo>(</mo><mi>x</mi>' +3788 '<mo>)</mo></mrow>',3789 '<appl>' +3790 '<content>' +3791 '<punctuation>\u2061</punctuation>' +3792 '</content>' +3793 '<children>' +3794 '<superscript>' +3795 '<children>' +3796 '<function>sin</function>' +3797 '<number>2</number>' +3798 '</children>' +3799 '</superscript>' +3800 '<fenced>' +3801 '<content>' +3802 '<fence>(</fence>' +3803 '<fence>)</fence>' +3804 '</content>' +3805 '<children>' +3806 '<identifier>x</identifier>' +3807 '</children>' +3808 '</fenced>' +3809 '</children>' +3810 '</appl>');3811 this.executeTreeTest(3812 '<mrow><msub><mi>sin</mi><mn>1</mn></msub><mo>(</mo><mi>x</mi>' +3813 '<mo>)</mo></mrow>',3814 '<appl>' +3815 '<content>' +3816 '<punctuation>\u2061</punctuation>' +3817 '</content>' +3818 '<children>' +3819 '<subscript>' +3820 '<children>' +3821 '<function>sin</function>' +3822 '<number>1</number>' +3823 '</children>' +3824 '</subscript>' +3825 '<fenced>' +3826 '<content>' +3827 '<fence>(</fence>' +3828 '<fence>)</fence>' +3829 '</content>' +3830 '<children>' +3831 '<identifier>x</identifier>' +3832 '</children>' +3833 '</fenced>' +3834 '</children>' +3835 '</appl>');3836 this.executeTreeTest(3837 '<mrow><msubsup><mi>sin</mi><mn>2</mn><mn>1</mn></msubsup><mo>(</mo>' +3838 '<mi>x</mi><mo>)</mo></mrow>',3839 '<appl>' +3840 '<content>' +3841 '<punctuation>\u2061</punctuation>' +3842 '</content>' +3843 '<children>' +3844 '<superscript>' +3845 '<children>' +3846 '<subscript>' +3847 '<children>' +3848 '<function>sin</function>' +3849 '<number>2</number>' +3850 '</children>' +3851 '</subscript>' +3852 '<number>1</number>' +3853 '</children>' +3854 '</superscript>' +3855 '<fenced>' +3856 '<content>' +3857 '<fence>(</fence>' +3858 '<fence>)</fence>' +3859 '</content>' +3860 '<children>' +3861 '<identifier>x</identifier>' +3862 '</children>' +3863 '</fenced>' +3864 '</children>' +3865 '</appl>');3866 this.executeTreeTest(3867 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mo>(</mo><mi>x</mi>' +3868 '<mo>)</mo><mo>+</mo><msup><mi>cos</mi><mn>2</mn></msup><mo>(</mo>' +3869 '<mi>y</mi><mo>)</mo><mo>=</mo><mn>1</mn></mrow>',3870 '<relseq>=' +3871 '<content>' +3872 '<relation>=</relation>' +3873 '</content>' +3874 '<children>' +3875 '<infixop>+' +3876 '<content>' +3877 '<operator>+</operator>' +3878 '</content>' +3879 '<children>' +3880 '<appl>' +3881 '<content>' +3882 '<punctuation>\u2061</punctuation>' +3883 '</content>' +3884 '<children>' +3885 '<superscript>' +3886 '<children>' +3887 '<function>sin</function>' +3888 '<number>2</number>' +3889 '</children>' +3890 '</superscript>' +3891 '<fenced>' +3892 '<content>' +3893 '<fence>(</fence>' +3894 '<fence>)</fence>' +3895 '</content>' +3896 '<children>' +3897 '<identifier>x</identifier>' +3898 '</children>' +3899 '</fenced>' +3900 '</children>' +3901 '</appl>' +3902 '<appl>' +3903 '<content>' +3904 '<punctuation>\u2061</punctuation>' +3905 '</content>' +3906 '<children>' +3907 '<superscript>' +3908 '<children>' +3909 '<function>cos</function>' +3910 '<number>2</number>' +3911 '</children>' +3912 '</superscript>' +3913 '<fenced>' +3914 '<content>' +3915 '<fence>(</fence>' +3916 '<fence>)</fence>' +3917 '</content>' +3918 '<children>' +3919 '<identifier>y</identifier>' +3920 '</children>' +3921 '</fenced>' +3922 '</children>' +3923 '</appl>' +3924 '</children>' +3925 '</infixop>' +3926 '<number>1</number>' +3927 '</children>' +3928 '</relseq>');3929};3930/**3931 * Prefix function applications with unfenced arguments.3932 */3933cvox.SemanticTreeTest.prototype.testStreePrefixFuncsUnfenced = function() {3934 this.brief = true;3935 this.executeTreeTest(3936 '<mrow><mi>sin</mi><mi>x</mi></mrow>',3937 '<appl>' +3938 '<content>' +3939 '<punctuation>\u2061</punctuation>' +3940 '</content>' +3941 '<children>' +3942 '<function>sin</function>' +3943 '<identifier>x</identifier>' +3944 '</children>' +3945 '</appl>');3946 this.executeTreeTest(3947 '<mrow><mi>sin</mi><mi>x</mi><mi>y</mi></mrow>',3948 '<appl>' +3949 '<content>' +3950 '<punctuation>\u2061</punctuation>' +3951 '</content>' +3952 '<children>' +3953 '<function>sin</function>' +3954 '<infixop>\u2062' +3955 '<content>' +3956 '<operator>\u2062</operator>' +3957 '</content>' +3958 '<children>' +3959 '<identifier>x</identifier>' +3960 '<identifier>y</identifier>' +3961 '</children>' +3962 '</infixop>' +3963 '</children>' +3964 '</appl>');3965 this.executeTreeTest(3966 '<mrow><mi>sin</mi><msup><mi>x</mi><mn>2</mn></msup></mrow>',3967 '<appl>' +3968 '<content>' +3969 '<punctuation>\u2061</punctuation>' +3970 '</content>' +3971 '<children>' +3972 '<function>sin</function>' +3973 '<superscript>' +3974 '<children>' +3975 '<identifier>x</identifier>' +3976 '<number>2</number>' +3977 '</children>' +3978 '</superscript>' +3979 '</children>' +3980 '</appl>');3981 this.executeTreeTest(3982 '<mrow><mi>sin</mi><msub><mi>x</mi><mn>2</mn></msub></mrow>',3983 '<appl>' +3984 '<content>' +3985 '<punctuation>\u2061</punctuation>' +3986 '</content>' +3987 '<children>' +3988 '<function>sin</function>' +3989 '<subscript>' +3990 '<children>' +3991 '<identifier>x</identifier>' +3992 '<number>2</number>' +3993 '</children>' +3994 '</subscript>' +3995 '</children>' +3996 '</appl>');3997 this.executeTreeTest(3998 '<mrow><mi>sin</mi><msubsup><mi>x</mi><mn>2</mn><mn>1</mn>' +3999 '</msubsup></mrow>',4000 '<appl>' +4001 '<content>' +4002 '<punctuation>\u2061</punctuation>' +4003 '</content>' +4004 '<children>' +4005 '<function>sin</function>' +4006 '<superscript>' +4007 '<children>' +4008 '<subscript>' +4009 '<children>' +4010 '<identifier>x</identifier>' +4011 '<number>2</number>' +4012 '</children>' +4013 '</subscript>' +4014 '<number>1</number>' +4015 '</children>' +4016 '</superscript>' +4017 '</children>' +4018 '</appl>');4019 this.executeTreeTest(4020 '<mrow><mi>sin</mi><mover><mi>x</mi><mn>2</mn></mover></mrow>',4021 '<appl>' +4022 '<content>' +4023 '<punctuation>\u2061</punctuation>' +4024 '</content>' +4025 '<children>' +4026 '<function>sin</function>' +4027 '<overscore>' +4028 '<children>' +4029 '<identifier>x</identifier>' +4030 '<number>2</number>' +4031 '</children>' +4032 '</overscore>' +4033 '</children>' +4034 '</appl>');4035 this.executeTreeTest(4036 '<mrow><mi>sin</mi><munder><mi>x</mi><mn>2</mn></munder></mrow>',4037 '<appl>' +4038 '<content>' +4039 '<punctuation>\u2061</punctuation>' +4040 '</content>' +4041 '<children>' +4042 '<function>sin</function>' +4043 '<underscore>' +4044 '<children>' +4045 '<identifier>x</identifier>' +4046 '<number>2</number>' +4047 '</children>' +4048 '</underscore>' +4049 '</children>' +4050 '</appl>');4051 this.executeTreeTest(4052 '<mrow><mi>sin</mi><munderover><mi>x</mi><mn>2</mn><mn>1</mn>' +4053 '</munderover></mrow>',4054 '<appl>' +4055 '<content>' +4056 '<punctuation>\u2061</punctuation>' +4057 '</content>' +4058 '<children>' +4059 '<function>sin</function>' +4060 '<overscore>' +4061 '<children>' +4062 '<underscore>' +4063 '<children>' +4064 '<identifier>x</identifier>' +4065 '<number>2</number>' +4066 '</children>' +4067 '</underscore>' +4068 '<number>1</number>' +4069 '</children>' +4070 '</overscore>' +4071 '</children>' +4072 '</appl>');4073 this.executeTreeTest(4074 '<mrow><mi>sin</mi><mfrac><mn>1</mn><mn>2</mn></mfrac></mrow>',4075 '<appl>' +4076 '<content>' +4077 '<punctuation>\u2061</punctuation>' +4078 '</content>' +4079 '<children>' +4080 '<function>sin</function>' +4081 '<fraction>' +4082 '<children>' +4083 '<number>1</number>' +4084 '<number>2</number>' +4085 '</children>' +4086 '</fraction>' +4087 '</children>' +4088 '</appl>');4089};4090/**4091 * Prefix function applications with unfenced arguments in an operator4092 * expression.4093 */4094cvox.SemanticTreeTest.prototype.testStreePrefixFuncsUnfencedOps = function() {4095 this.brief = true;4096 this.executeTreeTest(4097 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mi>x</mi></mrow>',4098 '<infixop>+' +4099 '<content>' +4100 '<operator>+</operator>' +4101 '</content>' +4102 '<children>' +4103 '<number>1</number>' +4104 '<appl>' +4105 '<content>' +4106 '<punctuation>\u2061</punctuation>' +4107 '</content>' +4108 '<children>' +4109 '<function>sin</function>' +4110 '<identifier>x</identifier>' +4111 '</children>' +4112 '</appl>' +4113 '</children>' +4114 '</infixop>');4115 this.executeTreeTest(4116 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mn>2</mn></mrow>',4117 '<infixop>+' +4118 '<content>' +4119 '<operator>+</operator>' +4120 '</content>' +4121 '<children>' +4122 '<appl>' +4123 '<content>' +4124 '<punctuation>\u2061</punctuation>' +4125 '</content>' +4126 '<children>' +4127 '<function>sin</function>' +4128 '<identifier>x</identifier>' +4129 '</children>' +4130 '</appl>' +4131 '<number>2</number>' +4132 '</children>' +4133 '</infixop>');4134 this.executeTreeTest(4135 '<mrow><mn>1</mn><mo>+</mo><mi>sin</mi><mi>x</mi><mo>+</mo>' +4136 '<mn>2</mn></mrow>',4137 '<infixop>+' +4138 '<content>' +4139 '<operator>+</operator>' +4140 '<operator>+</operator>' +4141 '</content>' +4142 '<children>' +4143 '<number>1</number>' +4144 '<appl>' +4145 '<content>' +4146 '<punctuation>\u2061</punctuation>' +4147 '</content>' +4148 '<children>' +4149 '<function>sin</function>' +4150 '<identifier>x</identifier>' +4151 '</children>' +4152 '</appl>' +4153 '<number>2</number>' +4154 '</children>' +4155 '</infixop>');4156 this.executeTreeTest(4157 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mi>x</mi></mrow>',4158 '<infixop>+' +4159 '<content>' +4160 '<operator>+</operator>' +4161 '</content>' +4162 '<children>' +4163 '<identifier>a</identifier>' +4164 '<appl>' +4165 '<content>' +4166 '<punctuation>\u2061</punctuation>' +4167 '</content>' +4168 '<children>' +4169 '<function>sin</function>' +4170 '<identifier>x</identifier>' +4171 '</children>' +4172 '</appl>' +4173 '</children>' +4174 '</infixop>');4175 this.executeTreeTest(4176 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mo>b</mo></mrow>',4177 '<infixop>+' +4178 '<content>' +4179 '<operator>+</operator>' +4180 '</content>' +4181 '<children>' +4182 '<appl>' +4183 '<content>' +4184 '<punctuation>\u2061</punctuation>' +4185 '</content>' +4186 '<children>' +4187 '<function>sin</function>' +4188 '<identifier>x</identifier>' +4189 '</children>' +4190 '</appl>' +4191 '<identifier>b</identifier>' +4192 '</children>' +4193 '</infixop>');4194 this.executeTreeTest(4195 '<mrow><mo>a</mo><mo>+</mo><mi>sin</mi><mi>x</mi><mo>+</mo>' +4196 '<mo>b</mo></mrow>',4197 '<infixop>+' +4198 '<content>' +4199 '<operator>+</operator>' +4200 '<operator>+</operator>' +4201 '</content>' +4202 '<children>' +4203 '<identifier>a</identifier>' +4204 '<appl>' +4205 '<content>' +4206 '<punctuation>\u2061</punctuation>' +4207 '</content>' +4208 '<children>' +4209 '<function>sin</function>' +4210 '<identifier>x</identifier>' +4211 '</children>' +4212 '</appl>' +4213 '<identifier>b</identifier>' +4214 '</children>' +4215 '</infixop>');4216 this.executeTreeTest(4217 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mi>x</mi></mrow>',4218 '<relseq>=' +4219 '<content>' +4220 '<relation>=</relation>' +4221 '</content>' +4222 '<children>' +4223 '<identifier>a</identifier>' +4224 '<appl>' +4225 '<content>' +4226 '<punctuation>\u2061</punctuation>' +4227 '</content>' +4228 '<children>' +4229 '<function>sin</function>' +4230 '<identifier>x</identifier>' +4231 '</children>' +4232 '</appl>' +4233 '</children>' +4234 '</relseq>');4235 this.executeTreeTest(4236 '<mrow><mi>sin</mi><mi>x</mi><mo>=</mo><mo>b</mo></mrow>',4237 '<relseq>=' +4238 '<content>' +4239 '<relation>=</relation>' +4240 '</content>' +4241 '<children>' +4242 '<appl>' +4243 '<content>' +4244 '<punctuation>\u2061</punctuation>' +4245 '</content>' +4246 '<children>' +4247 '<function>sin</function>' +4248 '<identifier>x</identifier>' +4249 '</children>' +4250 '</appl>' +4251 '<identifier>b</identifier>' +4252 '</children>' +4253 '</relseq>');4254 this.executeTreeTest(4255 '<mrow><mo>a</mo><mo>=</mo><mi>sin</mi><mi>x</mi><mo>=</mo>' +4256 '<mo>b</mo></mrow>',4257 '<relseq>=' +4258 '<content>' +4259 '<relation>=</relation>' +4260 '<relation>=</relation>' +4261 '</content>' +4262 '<children>' +4263 '<identifier>a</identifier>' +4264 '<appl>' +4265 '<content>' +4266 '<punctuation>\u2061</punctuation>' +4267 '</content>' +4268 '<children>' +4269 '<function>sin</function>' +4270 '<identifier>x</identifier>' +4271 '</children>' +4272 '</appl>' +4273 '<identifier>b</identifier>' +4274 '</children>' +4275 '</relseq>');4276};4277/**4278 * Multiple prefix function applications with unfenced arguments.4279 */4280cvox.SemanticTreeTest.prototype.testStreePrefixFuncsMultiUnfenced = function() {4281 this.brief = true;4282 this.executeTreeTest(4283 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mi>cos</mi><mi>x</mi></mrow>',4284 '<infixop>+' +4285 '<content>' +4286 '<operator>+</operator>' +4287 '</content>' +4288 '<children>' +4289 '<appl>' +4290 '<content>' +4291 '<punctuation>\u2061</punctuation>' +4292 '</content>' +4293 '<children>' +4294 '<function>sin</function>' +4295 '<identifier>x</identifier>' +4296 '</children>' +4297 '</appl>' +4298 '<appl>' +4299 '<content>' +4300 '<punctuation>\u2061</punctuation>' +4301 '</content>' +4302 '<children>' +4303 '<function>cos</function>' +4304 '<identifier>x</identifier>' +4305 '</children>' +4306 '</appl>' +4307 '</children>' +4308 '</infixop>');4309 this.executeTreeTest(4310 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mi>cos</mi><mi>x</mi><mo>=</mo>' +4311 '<mi>tan</mi><mi>x</mi></mrow>',4312 '<relseq>=' +4313 '<content>' +4314 '<relation>=</relation>' +4315 '</content>' +4316 '<children>' +4317 '<infixop>+' +4318 '<content>' +4319 '<operator>+</operator>' +4320 '</content>' +4321 '<children>' +4322 '<appl>' +4323 '<content>' +4324 '<punctuation>\u2061</punctuation>' +4325 '</content>' +4326 '<children>' +4327 '<function>sin</function>' +4328 '<identifier>x</identifier>' +4329 '</children>' +4330 '</appl>' +4331 '<appl>' +4332 '<content>' +4333 '<punctuation>\u2061</punctuation>' +4334 '</content>' +4335 '<children>' +4336 '<function>cos</function>' +4337 '<identifier>x</identifier>' +4338 '</children>' +4339 '</appl>' +4340 '</children>' +4341 '</infixop>' +4342 '<appl>' +4343 '<content>' +4344 '<punctuation>\u2061</punctuation>' +4345 '</content>' +4346 '<children>' +4347 '<function>tan</function>' +4348 '<identifier>x</identifier>' +4349 '</children>' +4350 '</appl>' +4351 '</children>' +4352 '</relseq>');4353 this.executeTreeTest(4354 '<mrow><mi>sin</mi><mi>x</mi><mo>+</mo><mi>cos</mi><mi>y</mi><mo>=</mo>' +4355 '<mi>tan</mi><mi>x</mi><mi>y</mi></mrow>',4356 '<relseq>=' +4357 '<content>' +4358 '<relation>=</relation>' +4359 '</content>' +4360 '<children>' +4361 '<infixop>+' +4362 '<content>' +4363 '<operator>+</operator>' +4364 '</content>' +4365 '<children>' +4366 '<appl>' +4367 '<content>' +4368 '<punctuation>\u2061</punctuation>' +4369 '</content>' +4370 '<children>' +4371 '<function>sin</function>' +4372 '<identifier>x</identifier>' +4373 '</children>' +4374 '</appl>' +4375 '<appl>' +4376 '<content>' +4377 '<punctuation>\u2061</punctuation>' +4378 '</content>' +4379 '<children>' +4380 '<function>cos</function>' +4381 '<identifier>y</identifier>' +4382 '</children>' +4383 '</appl>' +4384 '</children>' +4385 '</infixop>' +4386 '<appl>' +4387 '<content>' +4388 '<punctuation>\u2061</punctuation>' +4389 '</content>' +4390 '<children>' +4391 '<function>tan</function>' +4392 '<infixop>\u2062' +4393 '<content>' +4394 '<operator>\u2062</operator>' +4395 '</content>' +4396 '<children>' +4397 '<identifier>x</identifier>' +4398 '<identifier>y</identifier>' +4399 '</children>' +4400 '</infixop>' +4401 '</children>' +4402 '</appl>' +4403 '</children>' +4404 '</relseq>');4405};4406/**4407 * Prefix function applications with sub- and superscripts and unfenced4408 * arguments.4409 */4410cvox.SemanticTreeTest.prototype.testStreePrefixFuncsScriptUnfenced =4411 function() {4412 this.brief = true;4413 this.executeTreeTest(4414 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mi>x</mi></mrow>',4415 '<appl>' +4416 '<content>' +4417 '<punctuation>\u2061</punctuation>' +4418 '</content>' +4419 '<children>' +4420 '<superscript>' +4421 '<children>' +4422 '<function>sin</function>' +4423 '<number>2</number>' +4424 '</children>' +4425 '</superscript>' +4426 '<identifier>x</identifier>' +4427 '</children>' +4428 '</appl>');4429 this.executeTreeTest(4430 '<mrow><msub><mi>sin</mi><mn>1</mn></msub><mi>x</mi></mrow>',4431 '<appl>' +4432 '<content>' +4433 '<punctuation>\u2061</punctuation>' +4434 '</content>' +4435 '<children>' +4436 '<subscript>' +4437 '<children>' +4438 '<function>sin</function>' +4439 '<number>1</number>' +4440 '</children>' +4441 '</subscript>' +4442 '<identifier>x</identifier>' +4443 '</children>' +4444 '</appl>');4445 this.executeTreeTest(4446 '<mrow><msubsup><mi>sin</mi><mn>2</mn><mn>1</mn></msubsup>' +4447 '<mi>x</mi></mrow>',4448 '<appl>' +4449 '<content>' +4450 '<punctuation>\u2061</punctuation>' +4451 '</content>' +4452 '<children>' +4453 '<superscript>' +4454 '<children>' +4455 '<subscript>' +4456 '<children>' +4457 '<function>sin</function>' +4458 '<number>2</number>' +4459 '</children>' +4460 '</subscript>' +4461 '<number>1</number>' +4462 '</children>' +4463 '</superscript>' +4464 '<identifier>x</identifier>' +4465 '</children>' +4466 '</appl>');4467 this.executeTreeTest(4468 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mi>x</mi><mo>+</mo><msup>' +4469 '<mi>cos</mi><mn>2</mn></msup><mi>y</mi><mo>=</mo><mn>1</mn></mrow>',4470 '<relseq>=' +4471 '<content>' +4472 '<relation>=</relation>' +4473 '</content>' +4474 '<children>' +4475 '<infixop>+' +4476 '<content>' +4477 '<operator>+</operator>' +4478 '</content>' +4479 '<children>' +4480 '<appl>' +4481 '<content>' +4482 '<punctuation>\u2061</punctuation>' +4483 '</content>' +4484 '<children>' +4485 '<superscript>' +4486 '<children>' +4487 '<function>sin</function>' +4488 '<number>2</number>' +4489 '</children>' +4490 '</superscript>' +4491 '<identifier>x</identifier>' +4492 '</children>' +4493 '</appl>' +4494 '<appl>' +4495 '<content>' +4496 '<punctuation>\u2061</punctuation>' +4497 '</content>' +4498 '<children>' +4499 '<superscript>' +4500 '<children>' +4501 '<function>cos</function>' +4502 '<number>2</number>' +4503 '</children>' +4504 '</superscript>' +4505 '<identifier>y</identifier>' +4506 '</children>' +4507 '</appl>' +4508 '</children>' +4509 '</infixop>' +4510 '<number>1</number>' +4511 '</children>' +4512 '</relseq>');4513 this.executeTreeTest(4514 '<mrow><msubsup><msubsup><mi>sin</mi><mn>2</mn><mn>1</mn>' +4515 '</msubsup><mi>n</mi><mi>m</mi></msubsup><mi>x</mi></mrow>',4516 '<appl>' +4517 '<content>' +4518 '<punctuation>\u2061</punctuation>' +4519 '</content>' +4520 '<children>' +4521 '<superscript>' +4522 '<children>' +4523 '<subscript>' +4524 '<children>' +4525 '<superscript>' +4526 '<children>' +4527 '<subscript>' +4528 '<children>' +4529 '<function>sin</function>' +4530 '<number>2</number>' +4531 '</children>' +4532 '</subscript>' +4533 '<number>1</number>' +4534 '</children>' +4535 '</superscript>' +4536 '<identifier>n</identifier>' +4537 '</children>' +4538 '</subscript>' +4539 '<identifier>m</identifier>' +4540 '</children>' +4541 '</superscript>' +4542 '<identifier>x</identifier>' +4543 '</children>' +4544 '</appl>');4545};4546/**4547 * Prefix functions without arguments.4548 */4549cvox.SemanticTreeTest.prototype.testStreePrefixFuncsNoArgs = function() {4550 this.brief = true;4551 this.executeTreeTest(4552 '<mi>sin</mi>',4553 '<function>sin</function>');4554 this.executeTreeTest(4555 '<msup><mi>sin</mi><mn>2</mn></msup>',4556 '<superscript>' +4557 '<children>' +4558 '<function>sin</function>' +4559 '<number>2</number>' +4560 '</children>' +4561 '</superscript>');4562 this.executeTreeTest(4563 '<msup><mi>sin</mi><mn>2</mn></msup><mo>+</mo><msup><mi>cos</mi>' +4564 '<mn>2</mn></msup>',4565 '<infixop>+' +4566 '<content>' +4567 '<operator>+</operator>' +4568 '</content>' +4569 '<children>' +4570 '<appl>' +4571 '<content>' +4572 '<punctuation>\u2061</punctuation>' +4573 '</content>' +4574 '<children>' +4575 '<superscript>' +4576 '<children>' +4577 '<function>sin</function>' +4578 '<number>2</number>' +4579 '</children>' +4580 '</superscript>' +4581 '<empty/>' +4582 '</children>' +4583 '</appl>' +4584 '<appl>' +4585 '<content>' +4586 '<punctuation>\u2061</punctuation>' +4587 '</content>' +4588 '<children>' +4589 '<superscript>' +4590 '<children>' +4591 '<function>cos</function>' +4592 '<number>2</number>' +4593 '</children>' +4594 '</superscript>' +4595 '<empty/>' +4596 '</children>' +4597 '</appl>' +4598 '</children>' +4599 '</infixop>');4600 this.executeTreeTest(4601 '<mrow><msup><mi>sin</mi><mn>2</mn></msup><mo>+</mo>' +4602 '<msup><mi>cos</mi><mn>2</mn></msup><mo>=</mo><mn>1</mn></mrow>',4603 '<relseq>=' +4604 '<content>' +4605 '<relation>=</relation>' +4606 '</content>' +4607 '<children>' +4608 '<infixop>+' +4609 '<content>' +4610 '<operator>+</operator>' +4611 '</content>' +4612 '<children>' +4613 '<appl>' +4614 '<content>' +4615 '<punctuation>\u2061</punctuation>' +4616 '</content>' +4617 '<children>' +4618 '<superscript>' +4619 '<children>' +4620 '<function>sin</function>' +4621 '<number>2</number>' +4622 '</children>' +4623 '</superscript>' +4624 '<empty/>' +4625 '</children>' +4626 '</appl>' +4627 '<appl>' +4628 '<content>' +4629 '<punctuation>\u2061</punctuation>' +4630 '</content>' +4631 '<children>' +4632 '<superscript>' +4633 '<children>' +4634 '<function>cos</function>' +4635 '<number>2</number>' +4636 '</children>' +4637 '</superscript>' +4638 '<empty/>' +4639 '</children>' +4640 '</appl>' +4641 '</children>' +4642 '</infixop>' +4643 '<number>1</number>' +4644 '</children>' +4645 '</relseq>');4646 this.executeTreeTest(4647 '<mrow><mi>sin</mi><mo>=</mo><mfrac><mn>1</mn>' +4648 '<mi>csc</mi></mfrac></mrow>',4649 '<relseq>=' +4650 '<content>' +4651 '<relation>=</relation>' +4652 '</content>' +4653 '<children>' +4654 '<appl>' +4655 '<content>' +4656 '<punctuation>\u2061</punctuation>' +4657 '</content>' +4658 '<children>' +4659 '<function>sin</function>' +4660 '<empty/>' +4661 '</children>' +4662 '</appl>' +4663 '<fraction>' +4664 '<children>' +4665 '<number>1</number>' +4666 '<function>csc</function>' +4667 '</children>' +4668 '</fraction>' +4669 '</children>' +4670 '</relseq>');4671};4672/**4673 * Nested prefix function applications, both with and without fenced arguments.4674 */4675cvox.SemanticTreeTest.prototype.testStreePrefixFuncsNested = function() {4676 this.brief = true;4677 this.executeTreeTest(4678 '<mrow><mi>log</mi><mi>cos</mi><mi>x</mi></mrow>',4679 '<appl>' +4680 '<content>' +4681 '<punctuation>\u2061</punctuation>' +4682 '</content>' +4683 '<children>' +4684 '<function>log</function>' +4685 '<appl>' +4686 '<content>' +4687 '<punctuation>\u2061</punctuation>' +4688 '</content>' +4689 '<children>' +4690 '<function>cos</function>' +4691 '<identifier>x</identifier>' +4692 '</children>' +4693 '</appl>' +4694 '</children>' +4695 '</appl>');4696 this.executeTreeTest(4697 '<mrow><mi>ln</mi><mo>(</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>)</mo></mrow>',4698 '<appl>' +4699 '<content>' +4700 '<punctuation>\u2061</punctuation>' +4701 '</content>' +4702 '<children>' +4703 '<function>ln</function>' +4704 '<fenced>' +4705 '<content>' +4706 '<fence>(</fence>' +4707 '<fence>)</fence>' +4708 '</content>' +4709 '<children>' +4710 '<appl>' +4711 '<content>' +4712 '<punctuation>\u2061</punctuation>' +4713 '</content>' +4714 '<children>' +4715 '<function>sin</function>' +4716 '<fenced>' +4717 '<content>' +4718 '<fence>(</fence>' +4719 '<fence>)</fence>' +4720 '</content>' +4721 '<children>' +4722 '<identifier>x</identifier>' +4723 '</children>' +4724 '</fenced>' +4725 '</children>' +4726 '</appl>' +4727 '</children>' +4728 '</fenced>' +4729 '</children>' +4730 '</appl>');4731 this.executeTreeTest(4732 '<mrow><mi>log</mi><mi>cos</mi><mi>x</mi><mo>=</mo><mi>ln</mi><mo>(</mo><mi>sin</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>)</mo></mrow>',4733 '<relseq>=' +4734 '<content>' +4735 '<relation>=</relation>' +4736 '</content>' +4737 '<children>' +4738 '<appl>' +4739 '<content>' +4740 '<punctuation>\u2061</punctuation>' +4741 '</content>' +4742 '<children>' +4743 '<function>log</function>' +4744 '<appl>' +4745 '<content>' +4746 '<punctuation>\u2061</punctuation>' +4747 '</content>' +4748 '<children>' +4749 '<function>cos</function>' +4750 '<identifier>x</identifier>' +4751 '</children>' +4752 '</appl>' +4753 '</children>' +4754 '</appl>' +4755 '<appl>' +4756 '<content>' +4757 '<punctuation>\u2061</punctuation>' +4758 '</content>' +4759 '<children>' +4760 '<function>ln</function>' +4761 '<fenced>' +4762 '<content>' +4763 '<fence>(</fence>' +4764 '<fence>)</fence>' +4765 '</content>' +4766 '<children>' +4767 '<appl>' +4768 '<content>' +4769 '<punctuation>\u2061</punctuation>' +4770 '</content>' +4771 '<children>' +4772 '<function>sin</function>' +4773 '<fenced>' +4774 '<content>' +4775 '<fence>(</fence>' +4776 '<fence>)</fence>' +4777 '</content>' +4778 '<children>' +4779 '<identifier>x</identifier>' +4780 '</children>' +4781 '</fenced>' +4782 '</children>' +4783 '</appl>' +4784 '</children>' +4785 '</fenced>' +4786 '</children>' +4787 '</appl>' +4788 '</children>' +4789 '</relseq>');4790};4791/**4792 * Variations of tables representing matrices, vectors, case statements,4793 * multiline equations and regular tables.4794 */4795cvox.SemanticTreeTest.prototype.testStreeTables = function() {4796 this.brief = false;4797 this.executeTreeTest(4798 '<mrow class="MJX-TeXAtom-ORD"><mi mathvariant="bold">A</mi>' +4799 '<mo>=</mo><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em">' +4800 '<mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd>' +4801 '<mn>2</mn></mtd><mtd><mn>3</mn></mtd></mtr></mtable><mo>]</mo>' +4802 '</mrow>',4803 '<relseq role="equality" id="16">=' +4804 '<content>' +4805 '<relation role="equality" id="1">=</relation>' +4806 '</content>' +4807 '<children>' +4808 '<identifier role="latinletter" font="bold" id="0">A</identifier>' +4809 '<matrix role="unknown" id="13">' +4810 '<content>' +4811 '<fence role="open" id="2">[</fence>' +4812 '<fence role="close" id="14">]</fence>' +4813 '</content>' +4814 '<children>' +4815 '<row role="matrix" id="7">' +4816 '<children>' +4817 '<cell role="matrix" id="4">' +4818 '<children>' +4819 '<number role="integer" font="normal" id="3">0</number>' +4820 '</children>' +4821 '</cell>' +4822 '<cell role="matrix" id="6">' +4823 '<children>' +4824 '<number role="integer" font="normal" id="5">1</number>' +4825 '</children>' +4826 '</cell>' +4827 '</children>' +4828 '</row>' +4829 '<row role="matrix" id="12">' +4830 '<children>' +4831 '<cell role="matrix" id="9">' +4832 '<children>' +4833 '<number role="integer" font="normal" id="8">2</number>' +4834 '</children>' +4835 '</cell>' +4836 '<cell role="matrix" id="11">' +4837 '<children>' +4838 '<number role="integer" font="normal" id="10">3</number>' +4839 '</children>' +4840 '</cell>' +4841 '</children>' +4842 '</row>' +4843 '</children>' +4844 '</matrix>' +4845 '</children>' +4846 '</relseq>');4847 this.executeTreeTest(4848 '<mo>[</mo><mtable rowspacing="4pt" columnspacing="1em"><mtr>' +4849 '<mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd>' +4850 '<mn>2</mn></mtd><mtd><mn>3</mn></mtd></mtr></mtable>' +4851 '<mo>]</mo>',4852 '<matrix role="unknown" id="11">' +4853 '<content>' +4854 '<fence role="open" id="0">[</fence>' +4855 '<fence role="close" id="12">]</fence>' +4856 '</content>' +4857 '<children>' +4858 '<row role="matrix" id="5">' +4859 '<children>' +4860 '<cell role="matrix" id="2">' +4861 '<children>' +4862 '<number role="integer" font="normal" id="1">0</number>' +4863 '</children>' +4864 '</cell>' +4865 '<cell role="matrix" id="4">' +4866 '<children>' +4867 '<number role="integer" font="normal" id="3">1</number>' +4868 '</children>' +4869 '</cell>' +4870 '</children>' +4871 '</row>' +4872 '<row role="matrix" id="10">' +4873 '<children>' +4874 '<cell role="matrix" id="7">' +4875 '<children>' +4876 '<number role="integer" font="normal" id="6">2</number>' +4877 '</children>' +4878 '</cell>' +4879 '<cell role="matrix" id="9">' +4880 '<children>' +4881 '<number role="integer" font="normal" id="8">3</number>' +4882 '</children>' +4883 '</cell>' +4884 '</children>' +4885 '</row>' +4886 '</children>' +4887 '</matrix>');4888 this.executeTreeTest(4889 '<mrow class="MJX-TeXAtom-ORD"><mi mathvariant="bold">V</mi>' +4890 '<mo>=</mo><mo>[</mo><mtable rowspacing="4pt" columnspacing="1em">' +4891 '<mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>2</mn></mtd></mtr>' +4892 '<mtr><mtd><mn>3</mn></mtd></mtr></mtable><mo>]</mo></mrow>',4893 '<relseq role="equality" id="15">=' +4894 '<content>' +4895 '<relation role="equality" id="1">=</relation>' +4896 '</content>' +4897 '<children>' +4898 '<identifier role="latinletter" font="bold" id="0">V</identifier>' +4899 '<vector role="unknown" id="12">' +4900 '<content>' +4901 '<fence role="open" id="2">[</fence>' +4902 '<fence role="close" id="13">]</fence>' +4903 '</content>' +4904 '<children>' +4905 '<line role="vector" id="5">' +4906 '<children>' +4907 '<number role="integer" font="normal" id="3">1</number>' +4908 '</children>' +4909 '</line>' +4910 '<line role="vector" id="8">' +4911 '<children>' +4912 '<number role="integer" font="normal" id="6">2</number>' +4913 '</children>' +4914 '</line>' +4915 '<line role="vector" id="11">' +4916 '<children>' +4917 '<number role="integer" font="normal" id="9">3</number>' +4918 '</children>' +4919 '</line>' +4920 '</children>' +4921 '</vector>' +4922 '</children>' +4923 '</relseq>');4924 this.executeTreeTest(4925 '<mo>[</mo><mtable rowspacing="4pt" columnspacing="1em">' +4926 '<mtr><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>2</mn></mtd></mtr>' +4927 '<mtr><mtd><mn>3</mn></mtd></mtr></mtable><mo>]</mo>',4928 '<vector role="unknown" id="10">' +4929 '<content>' +4930 '<fence role="open" id="0">[</fence>' +4931 '<fence role="close" id="11">]</fence>' +4932 '</content>' +4933 '<children>' +4934 '<line role="vector" id="3">' +4935 '<children>' +4936 '<number role="integer" font="normal" id="1">1</number>' +4937 '</children>' +4938 '</line>' +4939 '<line role="vector" id="6">' +4940 '<children>' +4941 '<number role="integer" font="normal" id="4">2</number>' +4942 '</children>' +4943 '</line>' +4944 '<line role="vector" id="9">' +4945 '<children>' +4946 '<number role="integer" font="normal" id="7">3</number>' +4947 '</children>' +4948 '</line>' +4949 '</children>' +4950 '</vector>');4951 this.executeTreeTest(4952 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd>' +4953 '<mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi></mtd>' +4954 '<mtd><mtext>sometimes</mtext></mtd></mtr></mtable></mrow>',4955 '<cases role="unknown" id="11">' +4956 '<content>' +4957 '<punctuation role="openfence" id="0">{</punctuation>' +4958 '</content>' +4959 '<children>' +4960 '<row role="cases" id="5">' +4961 '<children>' +4962 '<cell role="cases" id="2">' +4963 '<children>' +4964 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +4965 '</children>' +4966 '</cell>' +4967 '<cell role="cases" id="4">' +4968 '<children>' +4969 '<text role="unknown" id="3">often</text>' +4970 '</children>' +4971 '</cell>' +4972 '</children>' +4973 '</row>' +4974 '<row role="cases" id="10">' +4975 '<children>' +4976 '<cell role="cases" id="7">' +4977 '<children>' +4978 '<identifier role="latinletter" font="normal" id="6">b</identifier>' +4979 '</children>' +4980 '</cell>' +4981 '<cell role="cases" id="9">' +4982 '<children>' +4983 '<text role="unknown" id="8">sometimes</text>' +4984 '</children>' +4985 '</cell>' +4986 '</children>' +4987 '</row>' +4988 '</children>' +4989 '</cases>');4990 this.executeTreeTest(4991 '<mrow><mi mathvariant="bold">A</mi><mo>=</mo><mo>{</mo><mtable>' +4992 '<mtr><mtd><mi>a</mi></mtd><mtd><mtext>often</mtext></mtd></mtr>' +4993 '<mtr><mtd><mi>b</mi></mtd><mtd><mtext>sometimes</mtext></mtd></mtr>' +4994 '</mtable></mrow>',4995 '<relseq role="equality" id="14">=' +4996 '<content>' +4997 '<relation role="equality" id="1">=</relation>' +4998 '</content>' +4999 '<children>' +5000 '<identifier role="latinletter" font="bold" id="0">A</identifier>' +5001 '<cases role="unknown" id="13">' +5002 '<content>' +5003 '<punctuation role="openfence" id="2">{</punctuation>' +5004 '</content>' +5005 '<children>' +5006 '<row role="cases" id="7">' +5007 '<children>' +5008 '<cell role="cases" id="4">' +5009 '<children>' +5010 '<identifier role="latinletter" font="normal" id="3">a</identifier>' +5011 '</children>' +5012 '</cell>' +5013 '<cell role="cases" id="6">' +5014 '<children>' +5015 '<text role="unknown" id="5">often</text>' +5016 '</children>' +5017 '</cell>' +5018 '</children>' +5019 '</row>' +5020 '<row role="cases" id="12">' +5021 '<children>' +5022 '<cell role="cases" id="9">' +5023 '<children>' +5024 '<identifier role="latinletter" font="normal" id="8">b</identifier>' +5025 '</children>' +5026 '</cell>' +5027 '<cell role="cases" id="11">' +5028 '<children>' +5029 '<text role="unknown" id="10">sometimes</text>' +5030 '</children>' +5031 '</cell>' +5032 '</children>' +5033 '</row>' +5034 '</children>' +5035 '</cases>' +5036 '</children>' +5037 '</relseq>');5038 this.executeTreeTest(5039 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi></mtd><mtd>' +5040 '<mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi></mtd><mtd>' +5041 '<mtext>sometimes</mtext></mtd></mtr></mtable><mo>.</mo></mrow>',5042 '<punctuated role="endpunct" id="13">' +5043 '<content>' +5044 '<punctuation role="fullstop" id="12">.</punctuation>' +5045 '</content>' +5046 '<children>' +5047 '<cases role="unknown" id="11">' +5048 '<content>' +5049 '<punctuation role="openfence" id="0">{</punctuation>' +5050 '</content>' +5051 '<children>' +5052 '<row role="cases" id="5">' +5053 '<children>' +5054 '<cell role="cases" id="2">' +5055 '<children>' +5056 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +5057 '</children>' +5058 '</cell>' +5059 '<cell role="cases" id="4">' +5060 '<children>' +5061 '<text role="unknown" id="3">often</text>' +5062 '</children>' +5063 '</cell>' +5064 '</children>' +5065 '</row>' +5066 '<row role="cases" id="10">' +5067 '<children>' +5068 '<cell role="cases" id="7">' +5069 '<children>' +5070 '<identifier role="latinletter" font="normal" id="6">b</identifier>' +5071 '</children>' +5072 '</cell>' +5073 '<cell role="cases" id="9">' +5074 '<children>' +5075 '<text role="unknown" id="8">sometimes</text>' +5076 '</children>' +5077 '</cell>' +5078 '</children>' +5079 '</row>' +5080 '</children>' +5081 '</cases>' +5082 '<punctuation role="fullstop" id="12">.</punctuation>' +5083 '</children>' +5084 '</punctuated>');5085 this.executeTreeTest(5086 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi></mtd>' +5087 '<mtd><mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi></mtd>' +5088 '<mtd><mtext>sometimes</mtext></mtd></mtr></mtable>' +5089 '<mo>,</mo><mi>b</mi><mo>,</mo><mi>c</mi><mo>.</mo></mrow>',5090 '<punctuated role="sequence" id="17">' +5091 '<content>' +5092 '<punctuation role="unknown" id="12">,</punctuation>' +5093 '<punctuation role="unknown" id="14">,</punctuation>' +5094 '<punctuation role="fullstop" id="16">.</punctuation>' +5095 '</content>' +5096 '<children>' +5097 '<cases role="unknown" id="11">' +5098 '<content>' +5099 '<punctuation role="openfence" id="0">{</punctuation>' +5100 '</content>' +5101 '<children>' +5102 '<row role="cases" id="5">' +5103 '<children>' +5104 '<cell role="cases" id="2">' +5105 '<children>' +5106 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +5107 '</children>' +5108 '</cell>' +5109 '<cell role="cases" id="4">' +5110 '<children>' +5111 '<text role="unknown" id="3">often</text>' +5112 '</children>' +5113 '</cell>' +5114 '</children>' +5115 '</row>' +5116 '<row role="cases" id="10">' +5117 '<children>' +5118 '<cell role="cases" id="7">' +5119 '<children>' +5120 '<identifier role="latinletter" font="normal" id="6">b</identifier>' +5121 '</children>' +5122 '</cell>' +5123 '<cell role="cases" id="9">' +5124 '<children>' +5125 '<text role="unknown" id="8">sometimes</text>' +5126 '</children>' +5127 '</cell>' +5128 '</children>' +5129 '</row>' +5130 '</children>' +5131 '</cases>' +5132 '<punctuation role="unknown" id="12">,</punctuation>' +5133 '<identifier role="latinletter" font="normal" id="13">b</identifier>' +5134 '<punctuation role="unknown" id="14">,</punctuation>' +5135 '<identifier role="latinletter" font="normal" id="15">c</identifier>' +5136 '<punctuation role="fullstop" id="16">.</punctuation>' +5137 '</children>' +5138 '</punctuated>');5139 this.executeTreeTest(5140 '<mrow><mo>{</mo><mtable><mtr><mtd><mi>a</mi><mo>,</mo>' +5141 '<mtext>often</mtext></mtd></mtr><mtr><mtd><mi>b</mi><mo>,</mo>' +5142 '<mtext>sometimes</mtext></mtd></mtr></mtable><mo>,</mo><mi>b</mi>' +5143 '<mo>,</mo><mi>c</mi><mo>.</mo></mrow>',5144 '<punctuated role="sequence" id="19">' +5145 '<content>' +5146 '<punctuation role="unknown" id="14">,</punctuation>' +5147 '<punctuation role="unknown" id="16">,</punctuation>' +5148 '<punctuation role="fullstop" id="18">.</punctuation>' +5149 '</content>' +5150 '<children>' +5151 '<cases role="unknown" id="13">' +5152 '<content>' +5153 '<punctuation role="openfence" id="0">{</punctuation>' +5154 '</content>' +5155 '<children>' +5156 '<line role="cases" id="6">' +5157 '<children>' +5158 '<punctuated role="sequence" id="4">' +5159 '<content>' +5160 '<punctuation role="unknown" id="2">,</punctuation>' +5161 '</content>' +5162 '<children>' +5163 '<identifier role="latinletter" font="normal" id="1">a</identifier>' +5164 '<punctuation role="unknown" id="2">,</punctuation>' +5165 '<text role="unknown" id="3">often</text>' +5166 '</children>' +5167 '</punctuated>' +5168 '</children>' +5169 '</line>' +5170 '<line role="cases" id="12">' +5171 '<children>' +5172 '<punctuated role="sequence" id="10">' +5173 '<content>' +5174 '<punctuation role="unknown" id="8">,</punctuation>' +5175 '</content>' +5176 '<children>' +5177 '<identifier role="latinletter" font="normal" id="7">b</identifier>' +5178 '<punctuation role="unknown" id="8">,</punctuation>' +5179 '<text role="unknown" id="9">sometimes</text>' +5180 '</children>' +5181 '</punctuated>' +5182 '</children>' +5183 '</line>' +5184 '</children>' +5185 '</cases>' +5186 '<punctuation role="unknown" id="14">,</punctuation>' +5187 '<identifier role="latinletter" font="normal" id="15">b</identifier>' +5188 '<punctuation role="unknown" id="16">,</punctuation>' +5189 '<identifier role="latinletter" font="normal" id="17">c</identifier>' +5190 '<punctuation role="fullstop" id="18">.</punctuation>' +5191 '</children>' +5192 '</punctuated>');5193 this.executeTreeTest(5194 '<mtable><mtr><mtd><mi>x</mi><maligngroup/><mo>=</mo><mn>4</mn>' +5195 '</mtd></mtr><mtr><mtd><mi>y</mi><maligngroup/><mo>=</mo><mn>2</mn>' +5196 '</mtd></mtr><mtr><mtd><mi>x</mi><mi>y</mi><maligngroup/><mo>=</mo>' +5197 '<mn>6</mn></mtd></mtr></mtable>',5198 '<multiline role="unknown" id="21">' +5199 '<children>' +5200 '<line role="multiline" id="5">' +5201 '<children>' +5202 '<relseq role="equality" id="3">=' +5203 '<content>' +5204 '<relation role="equality" id="1">=</relation>' +5205 '</content>' +5206 '<children>' +5207 '<identifier role="latinletter" font="normal" id="0">x</identifier>' +5208 '<number role="integer" font="normal" id="2">4</number>' +5209 '</children>' +5210 '</relseq>' +5211 '</children>' +5212 '</line>' +5213 '<line role="multiline" id="11">' +5214 '<children>' +5215 '<relseq role="equality" id="9">=' +5216 '<content>' +5217 '<relation role="equality" id="7">=</relation>' +5218 '</content>' +5219 '<children>' +5220 '<identifier role="latinletter" font="normal" id="6">y</identifier>' +5221 '<number role="integer" font="normal" id="8">2</number>' +5222 '</children>' +5223 '</relseq>' +5224 '</children>' +5225 '</line>' +5226 '<line role="multiline" id="20">' +5227 '<children>' +5228 '<relseq role="equality" id="18">=' +5229 '<content>' +5230 '<relation role="equality" id="14">=</relation>' +5231 '</content>' +5232 '<children>' +5233 '<infixop role="implicit" id="17">\u2062' +5234 '<content>' +5235 '<operator role="multiplication" id="16">\u2062</operator>' +5236 '</content>' +5237 '<children>' +5238 '<identifier role="latinletter" font="normal" id="12">x</identifier>' +5239 '<identifier role="latinletter" font="normal" id="13">y</identifier>' +5240 '</children>' +5241 '</infixop>' +5242 '<number role="integer" font="normal" id="15">6</number>' +5243 '</children>' +5244 '</relseq>' +5245 '</children>' +5246 '</line>' +5247 '</children>' +5248 '</multiline>');5249 this.executeTreeTest(5250 '<mtable><mtr><mtd><mi>x</mi></mtd><mtd><mo>=</mo></mtd><mtd><mn>4</mn>' +5251 '</mtd></mtr><mtr><mtd><mi>y</mi></mtd><mtd><mo>=</mo></mtd><mtd>' +5252 '<mn>2</mn></mtd></mtr><mtr><mtd><mi>x</mi><mi>y</mi></mtd><mtd>' +5253 '<mo>=</mo></mtd><mtd><mn>6</mn></mtd></mtr></mtable>',5254 '<table role="unknown" id="24">' +5255 '<children>' +5256 '<row role="table" id="6">' +5257 '<children>' +5258 '<cell role="table" id="1">' +5259 '<children>' +5260 '<identifier role="latinletter" font="normal" id="0">x</identifier>' +5261 '</children>' +5262 '</cell>' +5263 '<cell role="table" id="3">' +5264 '<children>' +5265 '<relation role="equality" id="2">=</relation>' +5266 '</children>' +5267 '</cell>' +5268 '<cell role="table" id="5">' +5269 '<children>' +5270 '<number role="integer" font="normal" id="4">4</number>' +5271 '</children>' +5272 '</cell>' +5273 '</children>' +5274 '</row>' +5275 '<row role="table" id="13">' +5276 '<children>' +5277 '<cell role="table" id="8">' +5278 '<children>' +5279 '<identifier role="latinletter" font="normal" id="7">y</identifier>' +5280 '</children>' +5281 '</cell>' +5282 '<cell role="table" id="10">' +5283 '<children>' +5284 '<relation role="equality" id="9">=</relation>' +5285 '</children>' +5286 '</cell>' +5287 '<cell role="table" id="12">' +5288 '<children>' +5289 '<number role="integer" font="normal" id="11">2</number>' +5290 '</children>' +5291 '</cell>' +5292 '</children>' +5293 '</row>' +5294 '<row role="table" id="23">' +5295 '<children>' +5296 '<cell role="table" id="18">' +5297 '<children>' +5298 '<infixop role="implicit" id="17">\u2062' +5299 '<content>' +5300 '<operator role="multiplication" id="16">\u2062</operator>' +5301 '</content>' +5302 '<children>' +5303 '<identifier role="latinletter" font="normal" id="14">x</identifier>' +5304 '<identifier role="latinletter" font="normal" id="15">y</identifier>' +5305 '</children>' +5306 '</infixop>' +5307 '</children>' +5308 '</cell>' +5309 '<cell role="table" id="20">' +5310 '<children>' +5311 '<relation role="equality" id="19">=</relation>' +5312 '</children>' +5313 '</cell>' +5314 '<cell role="table" id="22">' +5315 '<children>' +5316 '<number role="integer" font="normal" id="21">6</number>' +5317 '</children>' +5318 '</cell>' +5319 '</children>' +5320 '</row>' +5321 '</children>' +5322 '</table>');5323};5324cvox.SemanticTreeTest.prototype.testStreeLimitFunctions = function() {5325 this.brief = true;5326 this.executeTreeTest(5327 '<mrow><munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo>' +5328 '<mi>\u221E</mi></mrow></munder><mo>(</mo><mi>x</mi><mo>)</mo></mrow>',5329 '<appl>' +5330 '<content>' +5331 '<punctuation>\u2061</punctuation>' +5332 '</content>' +5333 '<children>' +5334 '<limlower>' +5335 '<children>' +5336 '<function>lim</function>' +5337 '<relseq>\u2192' +5338 '<content>' +5339 '<relation>\u2192</relation>' +5340 '</content>' +5341 '<children>' +5342 '<identifier>x</identifier>' +5343 '<identifier>\u221E</identifier>' +5344 '</children>' +5345 '</relseq>' +5346 '</children>' +5347 '</limlower>' +5348 '<fenced>' +5349 '<content>' +5350 '<fence>(</fence>' +5351 '<fence>)</fence>' +5352 '</content>' +5353 '<children>' +5354 '<identifier>x</identifier>' +5355 '</children>' +5356 '</fenced>' +5357 '</children>' +5358 '</appl>');5359 this.executeTreeTest(5360 '<mrow><mi>a</mi><mo>+</mo><munder><mi>lim</mi><mrow><mi>x</mi>' +5361 '<mo>\u2192</mo><mi>\u221E</mi></mrow></munder><mo>(</mo><mi>x</mi>' +5362 '<mo>)</mo><mo>+</mo><mi>b</mi></mrow>',5363 '<infixop>+' +5364 '<content>' +5365 '<operator>+</operator>' +5366 '<operator>+</operator>' +5367 '</content>' +5368 '<children>' +5369 '<identifier>a</identifier>' +5370 '<appl>' +5371 '<content>' +5372 '<punctuation>\u2061</punctuation>' +5373 '</content>' +5374 '<children>' +5375 '<limlower>' +5376 '<children>' +5377 '<function>lim</function>' +5378 '<relseq>\u2192' +5379 '<content>' +5380 '<relation>\u2192</relation>' +5381 '</content>' +5382 '<children>' +5383 '<identifier>x</identifier>' +5384 '<identifier>\u221E</identifier>' +5385 '</children>' +5386 '</relseq>' +5387 '</children>' +5388 '</limlower>' +5389 '<fenced>' +5390 '<content>' +5391 '<fence>(</fence>' +5392 '<fence>)</fence>' +5393 '</content>' +5394 '<children>' +5395 '<identifier>x</identifier>' +5396 '</children>' +5397 '</fenced>' +5398 '</children>' +5399 '</appl>' +5400 '<identifier>b</identifier>' +5401 '</children>' +5402 '</infixop>');5403 this.executeTreeTest(5404 '<mrow><msup><munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo>' +5405 '<mi>\u221E</mi></mrow></munder><mo>+</mo></msup><mo>(</mo><mi>x</mi>' +5406 '<mo>)</mo></mrow>',5407 '<appl>' +5408 '<content>' +5409 '<punctuation>\u2061</punctuation>' +5410 '</content>' +5411 '<children>' +5412 '<limupper>' +5413 '<children>' +5414 '<limlower>' +5415 '<children>' +5416 '<function>lim</function>' +5417 '<relseq>\u2192' +5418 '<content>' +5419 '<relation>\u2192</relation>' +5420 '</content>' +5421 '<children>' +5422 '<identifier>x</identifier>' +5423 '<identifier>\u221E</identifier>' +5424 '</children>' +5425 '</relseq>' +5426 '</children>' +5427 '</limlower>' +5428 '<operator>+</operator>' +5429 '</children>' +5430 '</limupper>' +5431 '<fenced>' +5432 '<content>' +5433 '<fence>(</fence>' +5434 '<fence>)</fence>' +5435 '</content>' +5436 '<children>' +5437 '<identifier>x</identifier>' +5438 '</children>' +5439 '</fenced>' +5440 '</children>' +5441 '</appl>');5442 this.executeTreeTest(5443 '<mrow><munderover><mi>lim</mi><mo>\u2015</mo><mrow><mi>x</mi>' +5444 '<mo>\u2192</mo><mi>\u221E</mi></mrow></munderover><mo>(</mo>' +5445 '<mi>x</mi><mo>)</mo></mrow>',5446 '<appl>' +5447 '<content>' +5448 '<punctuation>\u2061</punctuation>' +5449 '</content>' +5450 '<children>' +5451 '<limboth>' +5452 '<children>' +5453 '<function>lim</function>' +5454 '<punctuation>\u2015</punctuation>' +5455 '<relseq>\u2192' +5456 '<content>' +5457 '<relation>\u2192</relation>' +5458 '</content>' +5459 '<children>' +5460 '<identifier>x</identifier>' +5461 '<identifier>\u221E</identifier>' +5462 '</children>' +5463 '</relseq>' +5464 '</children>' +5465 '</limboth>' +5466 '<fenced>' +5467 '<content>' +5468 '<fence>(</fence>' +5469 '<fence>)</fence>' +5470 '</content>' +5471 '<children>' +5472 '<identifier>x</identifier>' +5473 '</children>' +5474 '</fenced>' +5475 '</children>' +5476 '</appl>');5477 this.executeTreeTest(5478 '<mrow><munder><mi>liminf</mi><mrow><mi>x</mi><mo>\u2192</mo>' +5479 '<mi>\u221E</mi></mrow></munder><mo>(</mo><mi>x</mi><mo>)</mo>' +5480 '<mo>+</mo><munder><mi>limsup</mi><mrow><mi>y</mi><mo>\u2192</mo>' +5481 '<mi>\u221E</mi></mrow></munder><mo>(</mo><mi>y</mi><mo>)</mo></mrow>',5482 '<infixop>+' +5483 '<content>' +5484 '<operator>+</operator>' +5485 '</content>' +5486 '<children>' +5487 '<appl>' +5488 '<content>' +5489 '<punctuation>\u2061</punctuation>' +5490 '</content>' +5491 '<children>' +5492 '<limlower>' +5493 '<children>' +5494 '<function>liminf</function>' +5495 '<relseq>\u2192' +5496 '<content>' +5497 '<relation>\u2192</relation>' +5498 '</content>' +5499 '<children>' +5500 '<identifier>x</identifier>' +5501 '<identifier>\u221E</identifier>' +5502 '</children>' +5503 '</relseq>' +5504 '</children>' +5505 '</limlower>' +5506 '<fenced>' +5507 '<content>' +5508 '<fence>(</fence>' +5509 '<fence>)</fence>' +5510 '</content>' +5511 '<children>' +5512 '<identifier>x</identifier>' +5513 '</children>' +5514 '</fenced>' +5515 '</children>' +5516 '</appl>' +5517 '<appl>' +5518 '<content>' +5519 '<punctuation>\u2061</punctuation>' +5520 '</content>' +5521 '<children>' +5522 '<limlower>' +5523 '<children>' +5524 '<function>limsup</function>' +5525 '<relseq>\u2192' +5526 '<content>' +5527 '<relation>\u2192</relation>' +5528 '</content>' +5529 '<children>' +5530 '<identifier>y</identifier>' +5531 '<identifier>\u221E</identifier>' +5532 '</children>' +5533 '</relseq>' +5534 '</children>' +5535 '</limlower>' +5536 '<fenced>' +5537 '<content>' +5538 '<fence>(</fence>' +5539 '<fence>)</fence>' +5540 '</content>' +5541 '<children>' +5542 '<identifier>y</identifier>' +5543 '</children>' +5544 '</fenced>' +5545 '</children>' +5546 '</appl>' +5547 '</children>' +5548 '</infixop>');5549 this.executeTreeTest(5550 '<mrow><mi>a</mi><mo>+</mo><munder><mi>lim</mi><mrow><mi>x</mi>' +5551 '<mo>\u2192</mo><mi>\u221E</mi></mrow></munder><mi>x</mi><mo>+</mo>' +5552 '<mi>b</mi></mrow>',5553 '<infixop>+' +5554 '<content>' +5555 '<operator>+</operator>' +5556 '<operator>+</operator>' +5557 '</content>' +5558 '<children>' +5559 '<identifier>a</identifier>' +5560 '<appl>' +5561 '<content>' +5562 '<punctuation>\u2061</punctuation>' +5563 '</content>' +5564 '<children>' +5565 '<limlower>' +5566 '<children>' +5567 '<function>lim</function>' +5568 '<relseq>\u2192' +5569 '<content>' +5570 '<relation>\u2192</relation>' +5571 '</content>' +5572 '<children>' +5573 '<identifier>x</identifier>' +5574 '<identifier>\u221E</identifier>' +5575 '</children>' +5576 '</relseq>' +5577 '</children>' +5578 '</limlower>' +5579 '<identifier>x</identifier>' +5580 '</children>' +5581 '</appl>' +5582 '<identifier>b</identifier>' +5583 '</children>' +5584 '</infixop>');5585 this.executeTreeTest(5586 '<mrow><munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo><mi>\u221E</mi>' +5587 '</mrow></munder><mi>lim</mi><munder><mrow><mi>y</mi><mo>\u2192</mo>' +5588 '<mi>\u221E</mi></mrow></munder><mi>x</mi><mi>y</mi></mrow>',5589 '<appl>' +5590 '<content>' +5591 '<punctuation>\u2061</punctuation>' +5592 '</content>' +5593 '<children>' +5594 '<limlower>' +5595 '<children>' +5596 '<function>lim</function>' +5597 '<relseq>\u2192' +5598 '<content>' +5599 '<relation>\u2192</relation>' +5600 '</content>' +5601 '<children>' +5602 '<identifier>x</identifier>' +5603 '<identifier>\u221E</identifier>' +5604 '</children>' +5605 '</relseq>' +5606 '</children>' +5607 '</limlower>' +5608 '<appl>' +5609 '<content>' +5610 '<punctuation>\u2061</punctuation>' +5611 '</content>' +5612 '<children>' +5613 '<function>lim</function>' +5614 '<infixop>\u2062' +5615 '<content>' +5616 '<operator>\u2062</operator>' +5617 '</content>' +5618 '<children>' +5619 '<underscore>' +5620 '<children>' +5621 '<relseq>\u2192' +5622 '<content>' +5623 '<relation>\u2192</relation>' +5624 '</content>' +5625 '<children>' +5626 '<identifier>y</identifier>' +5627 '<identifier>\u221E</identifier>' +5628 '</children>' +5629 '</relseq>' +5630 '</children>' +5631 '</underscore>' +5632 '<identifier>x</identifier>' +5633 '<identifier>y</identifier>' +5634 '</children>' +5635 '</infixop>' +5636 '</children>' +5637 '</appl>' +5638 '</children>' +5639 '</appl>');5640 this.executeTreeTest(5641 '<mi>liminf</mi>',5642 '<function>liminf</function>');5643 this.executeTreeTest(5644 '<munder><mi>lim</mi><mrow><mi>x</mi><mo>\u2192</mo><mi>\u221E</mi>' +5645 '</mrow></munder>',5646 '<limlower>' +5647 '<children>' +5648 '<function>lim</function>' +5649 '<relseq>\u2192' +5650 '<content>' +5651 '<relation>\u2192</relation>' +5652 '</content>' +5653 '<children>' +5654 '<identifier>x</identifier>' +5655 '<identifier>\u221E</identifier>' +5656 '</children>' +5657 '</relseq>' +5658 '</children>' +5659 '</limlower>');5660 this.executeTreeTest(5661 '<mi>liminf</mi><mo>+</mo><mi>limsup</mi><mo>=</mo><mi>lim</mi>',5662 '<relseq>=' +5663 '<content>' +5664 '<relation>=</relation>' +5665 '</content>' +5666 '<children>' +5667 '<infixop>+' +5668 '<content>' +5669 '<operator>+</operator>' +5670 '</content>' +5671 '<children>' +5672 '<appl>' +5673 '<content>' +5674 '<punctuation>\u2061</punctuation>' +5675 '</content>' +5676 '<children>' +5677 '<function>liminf</function>' +5678 '<empty/>' +5679 '</children>' +5680 '</appl>' +5681 '<appl>' +5682 '<content>' +5683 '<punctuation>\u2061</punctuation>' +5684 '</content>' +5685 '<children>' +5686 '<function>limsup</function>' +5687 '<empty/>' +5688 '</children>' +5689 '</appl>' +5690 '</children>' +5691 '</infixop>' +5692 '<appl>' +5693 '<content>' +5694 '<punctuation>\u2061</punctuation>' +5695 '</content>' +5696 '<children>' +5697 '<function>lim</function>' +5698 '<empty/>' +5699 '</children>' +5700 '</appl>' +5701 '</children>' +5702 '</relseq>');5703};5704/**5705 * Variations of big operators.5706 */5707cvox.SemanticTreeTest.prototype.testStreeBigOps = function() {5708 this.brief = true;5709 this.executeTreeTest(5710 '<mrow><munderover><mi>\u2211</mi><mrow><mi>n</mi><mo>=</mo><mn>0</mn>' +5711 '</mrow><mi>\u221E</mi></munderover><msup><mi>n</mi><mn>2</mn>' +5712 '</msup></mrow>',5713 '<bigop>' +5714 '<children>' +5715 '<limboth>' +5716 '<children>' +5717 '<largeop>\u2211</largeop>' +5718 '<relseq>=' +5719 '<content>' +5720 '<relation>=</relation>' +5721 '</content>' +5722 '<children>' +5723 '<identifier>n</identifier>' +5724 '<number>0</number>' +5725 '</children>' +5726 '</relseq>' +5727 '<identifier>\u221E</identifier>' +5728 '</children>' +5729 '</limboth>' +5730 '<superscript>' +5731 '<children>' +5732 '<identifier>n</identifier>' +5733 '<number>2</number>' +5734 '</children>' +5735 '</superscript>' +5736 '</children>' +5737 '</bigop>');5738 this.executeTreeTest(5739 '<mrow><munderover><mi>\u2211</mi><mrow><mi>n</mi><mo>=</mo><mn>0</mn>' +5740 '</mrow><mi>\u221E</mi></munderover><munderover><mi>\u2211</mi><mrow>' +5741 '<mi>m</mi><mo>=</mo><mn>0</mn></mrow><mi>\u221E</mi></munderover><msup>' +5742 '<mi>n</mi><mn>m</mn></msup></mrow>',5743 '<bigop>' +5744 '<children>' +5745 '<limboth>' +5746 '<children>' +5747 '<largeop>\u2211</largeop>' +5748 '<relseq>=' +5749 '<content>' +5750 '<relation>=</relation>' +5751 '</content>' +5752 '<children>' +5753 '<identifier>n</identifier>' +5754 '<number>0</number>' +5755 '</children>' +5756 '</relseq>' +5757 '<identifier>\u221E</identifier>' +5758 '</children>' +5759 '</limboth>' +5760 '<bigop>' +5761 '<children>' +5762 '<limboth>' +5763 '<children>' +5764 '<largeop>\u2211</largeop>' +5765 '<relseq>=' +5766 '<content>' +5767 '<relation>=</relation>' +5768 '</content>' +5769 '<children>' +5770 '<identifier>m</identifier>' +5771 '<number>0</number>' +5772 '</children>' +5773 '</relseq>' +5774 '<identifier>\u221E</identifier>' +5775 '</children>' +5776 '</limboth>' +5777 '<superscript>' +5778 '<children>' +5779 '<identifier>n</identifier>' +5780 '<identifier>m</identifier>' +5781 '</children>' +5782 '</superscript>' +5783 '</children>' +5784 '</bigop>' +5785 '</children>' +5786 '</bigop>');5787 this.executeTreeTest(5788 '<mrow><munder><mi>\u2211</mi><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow>' +5789 '</munder><msup><mi>n</mi><mn>2</mn></msup></mrow>',5790 '<bigop>' +5791 '<children>' +5792 '<limlower>' +5793 '<children>' +5794 '<largeop>\u2211</largeop>' +5795 '<relseq>=' +5796 '<content>' +5797 '<relation>=</relation>' +5798 '</content>' +5799 '<children>' +5800 '<identifier>n</identifier>' +5801 '<number>0</number>' +5802 '</children>' +5803 '</relseq>' +5804 '</children>' +5805 '</limlower>' +5806 '<superscript>' +5807 '<children>' +5808 '<identifier>n</identifier>' +5809 '<number>2</number>' +5810 '</children>' +5811 '</superscript>' +5812 '</children>' +5813 '</bigop>');5814};5815/**5816 * Variations of integrals.5817 */5818cvox.SemanticTreeTest.prototype.testStreeIntegrals = function() {5819 this.brief = true;5820 this.executeTreeTest(5821 '<mi>\u222B</mi>',5822 '<largeop>\u222B</largeop>');5823 this.executeTreeTest(5824 '<mi>\u222B</mi><mi>dx</mi>',5825 '<integral>' +5826 '<children>' +5827 '<largeop>\u222B</largeop>' +5828 '<empty/>' +5829 '<identifier>dx</identifier>' +5830 '</children>' +5831 '</integral>');5832 this.executeTreeTest(5833 '<mrow><mi>\u222B</mi><mi>x</mi><mi>dx</mi></mrow>',5834 '<integral>' +5835 '<children>' +5836 '<largeop>\u222B</largeop>' +5837 '<identifier>x</identifier>' +5838 '<identifier>dx</identifier>' +5839 '</children>' +5840 '</integral>');5841 this.executeTreeTest(5842 '<mrow><mi>\u222B</mi><mi>x</mi><mi>d</mi><mi>x</mi></mrow>',5843 '<integral>' +5844 '<children>' +5845 '<largeop>\u222B</largeop>' +5846 '<identifier>x</identifier>' +5847 '<punctuated>' +5848 '<content>' +5849 '<punctuation>\u2063</punctuation>' +5850 '</content>' +5851 '<children>' +5852 '<identifier>d</identifier>' +5853 '<punctuation>\u2063</punctuation>' +5854 '<identifier>x</identifier>' +5855 '</children>' +5856 '</punctuated>' +5857 '</children>' +5858 '</integral>');5859 this.executeTreeTest(5860 '<mrow><mi>\u222B</mi><mi>x</mi><mo>+</mo><mi>y</mi><mi>d</mi><mi>x</mi></mrow>',5861 '<integral>' +5862 '<children>' +5863 '<largeop>\u222B</largeop>' +5864 '<infixop>+' +5865 '<content>' +5866 '<operator>+</operator>' +5867 '</content>' +5868 '<children>' +5869 '<identifier>x</identifier>' +5870 '<identifier>y</identifier>' +5871 '</children>' +5872 '</infixop>' +5873 '<punctuated>' +5874 '<content>' +5875 '<punctuation>\u2063</punctuation>' +5876 '</content>' +5877 '<children>' +5878 '<identifier>d</identifier>' +5879 '<punctuation>\u2063</punctuation>' +5880 '<identifier>x</identifier>' +5881 '</children>' +5882 '</punctuated>' +5883 '</children>' +5884 '</integral>');5885 this.executeTreeTest(5886 '<munderover><mi>\u222B</mi><mn>0</mn><mn>10</mn></munderover>',5887 '<limboth>' +5888 '<children>' +5889 '<largeop>\u222B</largeop>' +5890 '<number>0</number>' +5891 '<number>10</number>' +5892 '</children>' +5893 '</limboth>');5894 this.executeTreeTest(5895 '<munder><mi>\u222B</mi><mn>X</mn></munder>',5896 '<limlower>' +5897 '<children>' +5898 '<largeop>\u222B</largeop>' +5899 '<identifier>X</identifier>' +5900 '</children>' +5901 '</limlower>');5902 this.executeTreeTest(5903 '<munderover><mi>\u222B</mi><mn>0</mn><mn>10</mn></munderover><mi>x</mi>' +5904 '<mi>d</mi><mi>x</mi>',5905 '<integral>' +5906 '<children>' +5907 '<limboth>' +5908 '<children>' +5909 '<largeop>\u222B</largeop>' +5910 '<number>0</number>' +5911 '<number>10</number>' +5912 '</children>' +5913 '</limboth>' +5914 '<identifier>x</identifier>' +5915 '<punctuated>' +5916 '<content>' +5917 '<punctuation>\u2063</punctuation>' +5918 '</content>' +5919 '<children>' +5920 '<identifier>d</identifier>' +5921 '<punctuation>\u2063</punctuation>' +5922 '<identifier>x</identifier>' +5923 '</children>' +5924 '</punctuated>' +5925 '</children>' +5926 '</integral>');5927 this.executeTreeTest(5928 '<munder><mi>\u222B</mi><mn>X</mn></munder><mi>x</mi><mi>dx</mi>',5929 '<integral>' +5930 '<children>' +5931 '<limlower>' +5932 '<children>' +5933 '<largeop>\u222B</largeop>' +5934 '<identifier>X</identifier>' +5935 '</children>' +5936 '</limlower>' +5937 '<identifier>x</identifier>' +5938 '<identifier>dx</identifier>' +5939 '</children>' +5940 '</integral>');5941 this.executeTreeTest(5942 '<munderover><mi>\u222B</mi><mn>0</mn><mn>10</mn></munderover><mi>x</mi>' +5943 '<mi>dx</mi><mo>+</mo><munderover><mi>\u222B</mi><mn>10</mn><mn>20</mn>' +5944 '</munderover><mi>x</mi><mi>dx</mi><mo>=</mo><munderover><mi>\u222B</mi>' +5945 '<mn>0</mn><mn>20</mn></munderover><mi>x</mi><mi>dx</mi>',5946 '<relseq>=' +5947 '<content>' +5948 '<relation>=</relation>' +5949 '</content>' +5950 '<children>' +5951 '<infixop>+' +5952 '<content>' +5953 '<operator>+</operator>' +5954 '</content>' +5955 '<children>' +5956 '<integral>' +5957 '<children>' +5958 '<limboth>' +5959 '<children>' +5960 '<largeop>\u222B</largeop>' +5961 '<number>0</number>' +5962 '<number>10</number>' +5963 '</children>' +5964 '</limboth>' +5965 '<identifier>x</identifier>' +5966 '<identifier>dx</identifier>' +5967 '</children>' +5968 '</integral>' +5969 '<integral>' +5970 '<children>' +5971 '<limboth>' +5972 '<children>' +5973 '<largeop>\u222B</largeop>' +5974 '<number>10</number>' +5975 '<number>20</number>' +5976 '</children>' +5977 '</limboth>' +5978 '<identifier>x</identifier>' +5979 '<identifier>dx</identifier>' +5980 '</children>' +5981 '</integral>' +5982 '</children>' +5983 '</infixop>' +5984 '<integral>' +5985 '<children>' +5986 '<limboth>' +5987 '<children>' +5988 '<largeop>\u222B</largeop>' +5989 '<number>0</number>' +5990 '<number>20</number>' +5991 '</children>' +5992 '</limboth>' +5993 '<identifier>x</identifier>' +5994 '<identifier>dx</identifier>' +5995 '</children>' +5996 '</integral>' +5997 '</children>' +5998 '</relseq>');5999 this.executeTreeTest(6000 '<mi>\u222B</mi><mi>\u222B</mi><mi>\u222B</mi><mi>dx</mi><mi>dy</mi><mi>dz</mi>',6001 '<integral>' +6002 '<children>' +6003 '<largeop>\u222B</largeop>' +6004 '<integral>' +6005 '<children>' +6006 '<largeop>\u222B</largeop>' +6007 '<integral>' +6008 '<children>' +6009 '<largeop>\u222B</largeop>' +6010 '<empty/>' +6011 '<identifier>dx</identifier>' +6012 '</children>' +6013 '</integral>' +6014 '<identifier>dy</identifier>' +6015 '</children>' +6016 '</integral>' +6017 '<identifier>dz</identifier>' +6018 '</children>' +6019 '</integral>');...

Full Screen

Full Screen

railFenceCipher.js

Source:railFenceCipher.js Github

copy

Full Screen

1/**2 * @typedef {string[]} Rail3 * @typedef {Rail[]} Fence4 * @typedef {number} Direction5 */6/**7 * @constant DIRECTIONS8 * @type {object}9 * @property {Direction} UP10 * @property {Direction} DOWN11 */12const DIRECTIONS = { UP: -1, DOWN: 1 };13/**14 * Builds a fence with a specific number of rows.15 *16 * @param {number} rowsNum17 * @returns {Fence}18 */19const buildFence = (rowsNum) => Array(rowsNum)20 .fill(null)21 .map(() => []);22/**23 * Get next direction to move (based on the current one) while traversing the fence.24 *25 * @param {object} params26 * @param {number} params.railCount - Number of rows in the fence27 * @param {number} params.currentRail - Current row that we're visiting28 * @param {Direction} params.direction - Current direction29 * @returns {Direction} - The next direction to take30 */31const getNextDirection = ({ railCount, currentRail, direction }) => {32 switch (currentRail) {33 case 0:34 // Go down if we're on top of the fence.35 return DIRECTIONS.DOWN;36 case railCount - 1:37 // Go up if we're at the bottom of the fence.38 return DIRECTIONS.UP;39 default:40 // Continue with the same direction if we're in the middle of the fence.41 return direction;42 }43};44/**45 * @param {number} targetRailIndex46 * @param {string} letter47 * @returns {Function}48 */49const addCharToRail = (targetRailIndex, letter) => {50 /**51 * Given a rail, adds a char to it if it matches a targetIndex.52 *53 * @param {Rail} rail54 * @param {number} currentRail55 * @returns {Rail}56 */57 function onEachRail(rail, currentRail) {58 return currentRail === targetRailIndex59 ? [...rail, letter]60 : rail;61 }62 return onEachRail;63};64/**65 * Hangs the characters on the fence.66 *67 * @param {object} params68 * @param {Fence} params.fence69 * @param {number} params.currentRail70 * @param {Direction} params.direction71 * @param {string[]} params.chars72 * @returns {Fence}73 */74const fillEncodeFence = ({75 fence,76 currentRail,77 direction,78 chars,79}) => {80 if (chars.length === 0) {81 // All chars have been placed on a fence.82 return fence;83 }84 const railCount = fence.length;85 // Getting the next character to place on a fence.86 const [letter, ...nextChars] = chars;87 const nextDirection = getNextDirection({88 railCount,89 currentRail,90 direction,91 });92 return fillEncodeFence({93 fence: fence.map(addCharToRail(currentRail, letter)),94 currentRail: currentRail + nextDirection,95 direction: nextDirection,96 chars: nextChars,97 });98};99/**100 * @param {object} params101 * @param {number} params.strLen102 * @param {string[]} params.chars103 * @param {Fence} params.fence104 * @param {number} params.targetRail105 * @param {Direction} params.direction106 * @param {number[]} params.coords107 * @returns {Fence}108 */109const fillDecodeFence = (params) => {110 const {111 strLen, chars, fence, targetRail, direction, coords,112 } = params;113 const railCount = fence.length;114 if (chars.length === 0) {115 return fence;116 }117 const [currentRail, currentColumn] = coords;118 const shouldGoNextRail = currentColumn === strLen - 1;119 const nextDirection = shouldGoNextRail120 ? DIRECTIONS.DOWN121 : getNextDirection(122 { railCount, currentRail, direction },123 );124 const nextRail = shouldGoNextRail ? targetRail + 1 : targetRail;125 const nextCoords = [126 shouldGoNextRail ? 0 : currentRail + nextDirection,127 shouldGoNextRail ? 0 : currentColumn + 1,128 ];129 const shouldAddChar = currentRail === targetRail;130 const [currentChar, ...remainderChars] = chars;131 const nextString = shouldAddChar ? remainderChars : chars;132 const nextFence = shouldAddChar ? fence.map(addCharToRail(currentRail, currentChar)) : fence;133 return fillDecodeFence({134 strLen,135 chars: nextString,136 fence: nextFence,137 targetRail: nextRail,138 direction: nextDirection,139 coords: nextCoords,140 });141};142/**143 * @param {object} params144 * @param {number} params.strLen145 * @param {Fence} params.fence146 * @param {number} params.currentRail147 * @param {Direction} params.direction148 * @param {number[]} params.code149 * @returns {string}150 */151const decodeFence = (params) => {152 const {153 strLen,154 fence,155 currentRail,156 direction,157 code,158 } = params;159 if (code.length === strLen) {160 return code.join('');161 }162 const railCount = fence.length;163 const [currentChar, ...nextRail] = fence[currentRail];164 const nextDirection = getNextDirection(165 { railCount, currentRail, direction },166 );167 return decodeFence({168 railCount,169 strLen,170 currentRail: currentRail + nextDirection,171 direction: nextDirection,172 code: [...code, currentChar],173 fence: fence.map((rail, idx) => (idx === currentRail ? nextRail : rail)),174 });175};176/**177 * Encodes the message using Rail Fence Cipher.178 *179 * @param {string} string - The string to be encoded180 * @param {number} railCount - The number of rails in a fence181 * @returns {string} - Encoded string182 */183export const encodeRailFenceCipher = (string, railCount) => {184 const fence = buildFence(railCount);185 const filledFence = fillEncodeFence({186 fence,187 currentRail: 0,188 direction: DIRECTIONS.DOWN,189 chars: string.split(''),190 });191 return filledFence.flat().join('');192};193/**194 * Decodes the message using Rail Fence Cipher.195 *196 * @param {string} string - Encoded string197 * @param {number} railCount - The number of rows in a fence198 * @returns {string} - Decoded string.199 */200export const decodeRailFenceCipher = (string, railCount) => {201 const strLen = string.length;202 const emptyFence = buildFence(railCount);203 const filledFence = fillDecodeFence({204 strLen,205 chars: string.split(''),206 fence: emptyFence,207 targetRail: 0,208 direction: DIRECTIONS.DOWN,209 coords: [0, 0],210 });211 return decodeFence({212 strLen,213 fence: filledFence,214 currentRail: 0,215 direction: DIRECTIONS.DOWN,216 code: [],217 });...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { addDecorator } from '@storybook/react';2import { withFence } from 'storybook-root-decorator';3addDecorator(withFence());4import { addDecorator } from '@storybook/react';5import { withFence } from 'storybook-root-decorator';6addDecorator(withFence({ color: 'red', width: '10px' }));7import { addDecorator } from '@storybook/react';8import { withFence } from 'storybook-root-decorator';9addDecorator(withFence({ color: 'red', width: '10px', height: '10px' }));10import { addDecorator } from '@storybook/react';11import { withFence } from 'storybook-root-decorator';12addDecorator(withFence({ color: 'red', width: '10px', height: '10px', style: 'dashed' }));13import { addDecorator } from '@storybook/react';14import { withFence } from 'storybook-root-decorator';15addDecorator(withFence({ color: 'red', width: '10px', height: '10px', style: 'dashed', position: 'absolute' }));16import { addDecorator } from '@storybook/react';17import { withFence } from 'storybook-root-decorator';18addDecorator(withFence({ color: 'red', width: '10px', height: '10px', style: 'dashed', position: 'absolute', top: '10px' }));19import { addDecorator } from '@storybook/react';20import { withFence } from 'storybook-root-decorator';21addDecorator(withFence({ color: 'red', width: '10px', height: '10px', style: 'dashed', position: 'absolute', top: '10px', right: '10px' }));22import { addDecorator } from '@storybook/react';23import { withFence } from 'storybook-root-decorator';24addDecorator(withFence

Full Screen

Using AI Code Generation

copy

Full Screen

1import React from 'react'2import { withFence } from 'storybook-root'3import { storiesOf } from '@storybook/react'4import { action } from '@storybook/addon-actions'5const MyComponent = () => (6 <button onClick={action('clicked')}>Click Me</button>7const MyComponentWithFence = withFence(MyComponent, {8})9storiesOf('MyComponent', module).add('with fence', () => (10import { withFence } from 'storybook-root'11import { configure, addDecorator } from '@storybook/react'12addDecorator(withFence)13configure(require.context('../src', true, /\.stories\.js$/), module)14import { withFence } from 'storybook-root'15import React from 'react'16import { storiesOf } from '@storybook/react'17import { action } from '@storybook/addon-actions'18import MyComponent from '../test'19const MyComponentWithFence = withFence(MyComponent, {20})21storiesOf('MyComponent', module).add('with fence', () => (22import React from 'react'23import { storiesOf } from '@storybook/react'24import { action } from '@storybook/addon-actions'25import MyComponent from '../test'26const MyComponentWithFence = withFence(MyComponent, {

Full Screen

Using AI Code Generation

copy

Full Screen

1import { withFence } from 'storybook-fence';2export const withFence = (storyFn, context) => {3 return withFence(storyFn, context);4};5export const decorators = [withFence];6import { withFence } from './test.js';7export const parameters = {8 fence: {9 },10};11import { addons } from '@storybook/addons';12import { withFence } from './test.js';13addons.setConfig({14});15module.exports = {16 core: {17 },18 managerWebpack: async (config) => {19 config.resolve.alias['storybook-fence'] = require.resolve('storybook-fence');20 return config;21 },22 webpackFinal: async (config) => {23 config.resolve.alias['storybook-fence'] = require.resolve('storybook-fence');24 return config;25 },26};27import { withFence } from 'storybook-fence';28export default {29 parameters: {30 fence: {31 },32 },33};34export const Basic = () => `35`;36export const WithOptions = () => `37`;38WithOptions.story = {39 parameters: {40 fence: {41 },42 },43};

Full Screen

Using AI Code Generation

copy

Full Screen

1import { configure, addDecorator } from '@storybook/react';2import { withFences } from 'storybook-root-decorator';3addDecorator(withFences);4import React from 'react';5import { storiesOf } from '@storybook/react';6import { withFences } from 'storybook-root-decorator';7import { withKnobs } from '@storybook/addon-knobs';8import { withInfo } from '@storybook/addon-info';9import { withA11y } from '@storybook/addon-a11y';10import { withTests } from '@storybook/addon-jest';11import { withPerformance } from 'storybook-addon-performance';12import { withConsole } from '@storybook/addon-console';13import { withViewport } from '@storybook/addon-viewport';14import { withBackgrounds } from '@storybook/addon-backgrounds';15import { withRedux } from 'storybook-addon-redux';16import { withReduxDecorator } from 'storybook-addon-redux-decorator';17import { withContexts } from '@storybook/addon-contexts/react';18import { withOptions } from '@storybook/addon-options';19import { withNotes } from '@storybook/addon-notes';20import { withLinks } from '@storybook/addon-links';21import { withPropsTable } from 'storybook-addon-react-docgen';22import { withPropsCombinations } from 'react-storybook-addon-props-combinations';23import { withStorysource } from '@storybook/addon-storysource';24import { withActions } from '@storybook/addon-actions';25import { withCSSResources } from '@storybook/addon-cssresources';26import { withGraphQL } from 'storybook-addon-graphql';27import { withStorybookInfo } from 'storybook-addon-storyout';28import { withTests as withTests2 } from '@storybook/addon-jest';29import { withStoryshots } from '@storybook/addon-storyshots';30import { withState } from '@dump247/storybook-state';31import { withSmartKnobs } from 'storybook-addon-smart-knobs';32import { withDsm } from '@invisionapp/dsm-storybook/register';33import { withTests as withTests3 } from 'storybook-addon-specifications';34import { withViewport as withViewport2 } from 'storybook-addon-viewport';35import { withThemesProvider } from 'storybook-addon-styled-component-theme';36import { withTests as withTests4 } from 'storybook-addon-test-results

Full Screen

Using AI Code Generation

copy

Full Screen

1import { mount } from 'cypress-react-unit-test';2import { getStorybook } from '@storybook/react';3import { getStorybookUI, configure } from '@storybook/react-native';4const storybook = getStorybook();5const stories = storybook.reduce((acc, { kind, stories }) => {6 stories.forEach(({ name }) => {7 acc.push({ kind, name });8 });9 return acc;10}, []);11stories.forEach(({ kind, name }) => {12 it(`${kind} ${name}`, () => {13 const story = getStorybookUI({ port: 7007, onDeviceUI: true });14 mount(story);15 cy.get(`[data-testid="story-${kind}-${name}"]`).click();16 });17});18{19 "testFiles": "**/*.{spec,test}.{js,jsx,ts,tsx}",20}21module.exports = {22 webpackFinal: async (config, { configType }) => {23 config.module.rules.push({24 {25 loader: require.resolve('babel-loader'),26 options: {27 presets: [['react-app', { flow: false, typescript: true }]],28 },29 },30 {31 loader: require.resolve('react-docgen-typescript-loader'),32 },33 });34 config.resolve.extensions.push('.ts', '.tsx');35 return config;36 },37};38import { addDecorator } from '@storybook/react';39import { withTests } from '@storybook/addon-jest';40import results from '../.jest-test-results.json';41addDecorator(42 withTests({43 })44);45import React from 'react';46import { Button, ButtonProps } from './Button';47import { Story, Meta } from '@storybook/react/types-6-0';48export default {49 argTypes: {50 backgroundColor: { control

Full Screen

Using AI Code Generation

copy

Full Screen

1import { withFence } from 'storybook-root';2export default {3};4export const Fence = () => <div>hello</div>;5import { addDecorator } from '@storybook/react';6import { withFence } from 'storybook-root';7addDecorator(withFence);8module.exports = {9};

Full Screen

Using AI Code Generation

copy

Full Screen

1import { withFence } from 'storybook-root';2export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);3import { withFence } from 'storybook-root/dist/fence';4export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);5import { withFence } from 'storybook-root';6export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);7import { withFence } from 'storybook-root';8export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);9import { withFence } from 'storybook-root/dist/fence';10export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);11import { withFence } from 'storybook-root';12export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);13import { withFence } from 'storybook-root/dist/fence';14export default withFence({ name: 'test', version: '1.0.0' })(() => <div>Test</div>);15import { withFence } from 'storybook-root';

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful