1// Copyright 2014 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5/** 6 * @fileoverview Speech rule store for mathml and mathjax trees. 7 */ 8 9goog.provide('cvox.MathmlStore'); 10 11goog.require('cvox.MathStore'); 12 13 14/** 15 * Rule initialization. 16 * @constructor 17 * @extends {cvox.MathStore} 18 */ 19cvox.MathmlStore = function() { 20 goog.base(this); 21}; 22goog.inherits(cvox.MathmlStore, cvox.MathStore); 23goog.addSingletonGetter(cvox.MathmlStore); 24 25 26/** 27 * Adds a new MathML speech rule. 28 * @param {string} name Rule name which corresponds to the MathML tag name. 29 * @param {string} domain Domain annotation of the rule. 30 * @param {string} rule String version of the speech rule. 31 */ 32cvox.MathmlStore.prototype.defineMathmlRule = function(name, domain, rule) { 33 this.defineRule(name, domain, rule, 'self::mathml:' + name); 34}; 35 36 37/** 38 * Adds a new MathML speech rule for the default.default domain. 39 * @param {string} name Rule name which corresponds to the MathML tag name. 40 * @param {string} rule String version of the speech rule. 41 */ 42cvox.MathmlStore.prototype.defineDefaultMathmlRule = function(name, rule) { 43 this.defineRule(name, 'default.default', rule, 'self::mathml:' + name); 44}; 45