PageRenderTime 29ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/files//1.8.0/string.js

https://gitlab.com/Mirros/jsdelivr
JavaScript | 980 lines | 893 code | 58 blank | 29 comment | 68 complexity | 4132018e0dacec6fe17bc799df9cb501 MD5 | raw file
  1. /*
  2. string.js - Copyright (C) 2012-2013, JP Richardson <jprichardson@gmail.com>
  3. */
  4. !(function() {
  5. "use strict";
  6. var VERSION = '1.8.0';
  7. var ENTITIES = {};
  8. //******************************************************************************
  9. // Added an initialize function which is essentially the code from the S
  10. // constructor. Now, the S constructor calls this and a new method named
  11. // setValue calls it as well. The setValue function allows constructors for
  12. // modules that extend string.js to set the initial value of an object without
  13. // knowing the internal workings of string.js.
  14. //
  15. // Also, all methods which return a new S object now call:
  16. //
  17. // return new this.constructor(s);
  18. //
  19. // instead of:
  20. //
  21. // return new S(s);
  22. //
  23. // This allows extended objects to keep their proper instanceOf and constructor.
  24. //******************************************************************************
  25. function initialize (object, s) {
  26. if (s !== null && s !== undefined) {
  27. if (typeof s === 'string')
  28. object.s = s;
  29. else
  30. object.s = s.toString();
  31. } else {
  32. object.s = s; //null or undefined
  33. }
  34. object.orig = s; //original object, currently only used by toCSV() and toBoolean()
  35. if (s !== null && s !== undefined) {
  36. if (object.__defineGetter__) {
  37. object.__defineGetter__('length', function() {
  38. return object.s.length;
  39. })
  40. } else {
  41. object.length = s.length;
  42. }
  43. } else {
  44. object.length = -1;
  45. }
  46. }
  47. function S(s) {
  48. initialize(this, s);
  49. }
  50. var __nsp = String.prototype;
  51. var __sp = S.prototype = {
  52. between: function(left, right) {
  53. var s = this.s;
  54. var startPos = s.indexOf(left);
  55. var endPos = s.indexOf(right, startPos + left.length);
  56. if (endPos == -1 && right != null)
  57. return new this.constructor('')
  58. else if (endPos == -1 && right == null)
  59. return new this.constructor(s.substring(startPos + left.length))
  60. else
  61. return new this.constructor(s.slice(startPos + left.length, endPos));
  62. },
  63. //# modified slightly from https://github.com/epeli/underscore.string
  64. camelize: function() {
  65. var s = this.trim().s.replace(/(\-|_|\s)+(.)?/g, function(mathc, sep, c) {
  66. return (c ? c.toUpperCase() : '');
  67. });
  68. return new this.constructor(s);
  69. },
  70. capitalize: function() {
  71. return new this.constructor(this.s.substr(0, 1).toUpperCase() + this.s.substring(1).toLowerCase());
  72. },
  73. charAt: function(index) {
  74. return this.s.charAt(index);
  75. },
  76. chompLeft: function(prefix) {
  77. var s = this.s;
  78. if (s.indexOf(prefix) === 0) {
  79. s = s.slice(prefix.length);
  80. return new this.constructor(s);
  81. } else {
  82. return this;
  83. }
  84. },
  85. chompRight: function(suffix) {
  86. if (this.endsWith(suffix)) {
  87. var s = this.s;
  88. s = s.slice(0, s.length - suffix.length);
  89. return new this.constructor(s);
  90. } else {
  91. return this;
  92. }
  93. },
  94. //#thanks Google
  95. collapseWhitespace: function() {
  96. var s = this.s.replace(/[\s\xa0]+/g, ' ').replace(/^\s+|\s+$/g, '');
  97. return new this.constructor(s);
  98. },
  99. contains: function(ss) {
  100. return this.s.indexOf(ss) >= 0;
  101. },
  102. count: function(ss) {
  103. var count = 0
  104. , pos = this.s.indexOf(ss)
  105. while (pos >= 0) {
  106. count += 1
  107. pos = this.s.indexOf(ss, pos + 1)
  108. }
  109. return count
  110. },
  111. //#modified from https://github.com/epeli/underscore.string
  112. dasherize: function() {
  113. var s = this.trim().s.replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase();
  114. return new this.constructor(s);
  115. },
  116. decodeHtmlEntities: function() { //https://github.com/substack/node-ent/blob/master/index.js
  117. var s = this.s;
  118. s = s.replace(/&#(\d+);?/g, function (_, code) {
  119. return String.fromCharCode(code);
  120. })
  121. .replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) {
  122. return String.fromCharCode(parseInt(hex, 16));
  123. })
  124. .replace(/&([^;\W]+;?)/g, function (m, e) {
  125. var ee = e.replace(/;$/, '');
  126. var target = ENTITIES[e] || (e.match(/;$/) && ENTITIES[ee]);
  127. if (typeof target === 'number') {
  128. return String.fromCharCode(target);
  129. }
  130. else if (typeof target === 'string') {
  131. return target;
  132. }
  133. else {
  134. return m;
  135. }
  136. })
  137. return new this.constructor(s);
  138. },
  139. endsWith: function(suffix) {
  140. var l = this.s.length - suffix.length;
  141. return l >= 0 && this.s.indexOf(suffix, l) === l;
  142. },
  143. escapeHTML: function() { //from underscore.string
  144. return new this.constructor(this.s.replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; }));
  145. },
  146. ensureLeft: function(prefix) {
  147. var s = this.s;
  148. if (s.indexOf(prefix) === 0) {
  149. return this;
  150. } else {
  151. return new this.constructor(prefix + s);
  152. }
  153. },
  154. ensureRight: function(suffix) {
  155. var s = this.s;
  156. if (this.endsWith(suffix)) {
  157. return this;
  158. } else {
  159. return new this.constructor(s + suffix);
  160. }
  161. },
  162. humanize: function() { //modified from underscore.string
  163. if (this.s === null || this.s === undefined)
  164. return new this.constructor('')
  165. var s = this.underscore().replace(/_id$/,'').replace(/_/g, ' ').trim().capitalize()
  166. return new this.constructor(s)
  167. },
  168. isAlpha: function() {
  169. return !/[^a-z\xC0-\xFF]/.test(this.s.toLowerCase());
  170. },
  171. isAlphaNumeric: function() {
  172. return !/[^0-9a-z\xC0-\xFF]/.test(this.s.toLowerCase());
  173. },
  174. isEmpty: function() {
  175. return this.s === null || this.s === undefined ? true : /^[\s\xa0]*$/.test(this.s);
  176. },
  177. isLower: function() {
  178. return this.isAlpha() && this.s.toLowerCase() === this.s;
  179. },
  180. isNumeric: function() {
  181. return !/[^0-9]/.test(this.s);
  182. },
  183. isUpper: function() {
  184. return this.isAlpha() && this.s.toUpperCase() === this.s;
  185. },
  186. left: function(N) {
  187. if (N >= 0) {
  188. var s = this.s.substr(0, N);
  189. return new this.constructor(s);
  190. } else {
  191. return this.right(-N);
  192. }
  193. },
  194. lines: function() { //convert windows newlines to unix newlines then convert to an Array of lines
  195. return this.replaceAll('\r\n', '\n').s.split('\n');
  196. },
  197. pad: function(len, ch) { //https://github.com/component/pad
  198. if (ch == null) ch = ' ';
  199. if (this.s.length >= len) return new this.constructor(this.s);
  200. len = len - this.s.length;
  201. var left = Array(Math.ceil(len / 2) + 1).join(ch);
  202. var right = Array(Math.floor(len / 2) + 1).join(ch);
  203. return new this.constructor(left + this.s + right);
  204. },
  205. padLeft: function(len, ch) { //https://github.com/component/pad
  206. if (ch == null) ch = ' ';
  207. if (this.s.length >= len) return new this.constructor(this.s);
  208. return new this.constructor(Array(len - this.s.length + 1).join(ch) + this.s);
  209. },
  210. padRight: function(len, ch) { //https://github.com/component/pad
  211. if (ch == null) ch = ' ';
  212. if (this.s.length >= len) return new this.constructor(this.s);
  213. return new this.constructor(this.s + Array(len - this.s.length + 1).join(ch));
  214. },
  215. parseCSV: function(delimiter, qualifier, escape, lineDelimiter) { //try to parse no matter what
  216. delimiter = delimiter || ',';
  217. escape = escape || '\\'
  218. if (typeof qualifier == 'undefined')
  219. qualifier = '"';
  220. var i = 0, fieldBuffer = [], fields = [], len = this.s.length, inField = false, self = this;
  221. var ca = function(i){return self.s.charAt(i)};
  222. if (typeof lineDelimiter !== 'undefined') var rows = [];
  223. if (!qualifier)
  224. inField = true;
  225. while (i < len) {
  226. var current = ca(i);
  227. switch (current) {
  228. case escape:
  229. //fix for issues #32 and #35
  230. if (inField && ((escape !== qualifier) || ca(i+1) === qualifier)) {
  231. i += 1;
  232. fieldBuffer.push(ca(i));
  233. break;
  234. }
  235. if (escape !== qualifier) break;
  236. case qualifier:
  237. inField = !inField;
  238. break;
  239. case delimiter:
  240. if (inField && qualifier)
  241. fieldBuffer.push(current);
  242. else {
  243. fields.push(fieldBuffer.join(''))
  244. fieldBuffer.length = 0;
  245. }
  246. break;
  247. case lineDelimiter:
  248. if (inField) {
  249. fieldBuffer.push(current);
  250. } else {
  251. if (rows) {
  252. fields.push(fieldBuffer.join(''))
  253. rows.push(fields);
  254. fields = [];
  255. fieldBuffer.length = 0;
  256. }
  257. }
  258. break;
  259. default:
  260. if (inField)
  261. fieldBuffer.push(current);
  262. break;
  263. }
  264. i += 1;
  265. }
  266. fields.push(fieldBuffer.join(''));
  267. if (rows) {
  268. rows.push(fields);
  269. return rows;
  270. }
  271. return fields;
  272. },
  273. replaceAll: function(ss, r) {
  274. //var s = this.s.replace(new RegExp(ss, 'g'), r);
  275. var s = this.s.split(ss).join(r)
  276. return new this.constructor(s);
  277. },
  278. right: function(N) {
  279. if (N >= 0) {
  280. var s = this.s.substr(this.s.length - N, N);
  281. return new this.constructor(s);
  282. } else {
  283. return this.left(-N);
  284. }
  285. },
  286. setValue: function (s) {
  287. initialize(this, s);
  288. return this;
  289. },
  290. slugify: function() {
  291. var sl = (new S(this.s.replace(/[^\w\s-]/g, '').toLowerCase())).dasherize().s;
  292. if (sl.charAt(0) === '-')
  293. sl = sl.substr(1);
  294. return new this.constructor(sl);
  295. },
  296. startsWith: function(prefix) {
  297. return this.s.lastIndexOf(prefix, 0) === 0;
  298. },
  299. stripPunctuation: function() {
  300. //return new this.constructor(this.s.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g,""));
  301. return new this.constructor(this.s.replace(/[^\w\s]|_/g, "").replace(/\s+/g, " "));
  302. },
  303. stripTags: function() { //from sugar.js
  304. var s = this.s, args = arguments.length > 0 ? arguments : [''];
  305. multiArgs(args, function(tag) {
  306. s = s.replace(RegExp('<\/?' + tag + '[^<>]*>', 'gi'), '');
  307. });
  308. return new this.constructor(s);
  309. },
  310. template: function(values, opening, closing) {
  311. var s = this.s
  312. var opening = opening || Export.TMPL_OPEN
  313. var closing = closing || Export.TMPL_CLOSE
  314. var open = opening.replace(/[-[\]()*\s]/g, "\\$&").replace(/\$/g, '\\$')
  315. var close = closing.replace(/[-[\]()*\s]/g, "\\$&").replace(/\$/g, '\\$')
  316. var r = new RegExp(open + '(.+?)' + close, 'g')
  317. //, r = /\{\{(.+?)\}\}/g
  318. var matches = s.match(r) || [];
  319. matches.forEach(function(match) {
  320. var key = match.substring(opening.length, match.length - closing.length);//chop {{ and }}
  321. if (typeof values[key] != 'undefined')
  322. s = s.replace(match, values[key]);
  323. });
  324. return new this.constructor(s);
  325. },
  326. times: function(n) {
  327. return new this.constructor(new Array(n + 1).join(this.s));
  328. },
  329. toBoolean: function() {
  330. if (typeof this.orig === 'string') {
  331. var s = this.s.toLowerCase();
  332. return s === 'true' || s === 'yes' || s === 'on';
  333. } else
  334. return this.orig === true || this.orig === 1;
  335. },
  336. toFloat: function(precision) {
  337. var num = parseFloat(this.s)
  338. if (precision)
  339. return parseFloat(num.toFixed(precision))
  340. else
  341. return num
  342. },
  343. toInt: function() { //thanks Google
  344. // If the string starts with '0x' or '-0x', parse as hex.
  345. return /^\s*-?0x/i.test(this.s) ? parseInt(this.s, 16) : parseInt(this.s, 10)
  346. },
  347. trim: function() {
  348. var s;
  349. if (typeof __nsp.trim === 'undefined')
  350. s = this.s.replace(/(^\s*|\s*$)/g, '')
  351. else
  352. s = this.s.trim()
  353. return new this.constructor(s);
  354. },
  355. trimLeft: function() {
  356. var s;
  357. if (__nsp.trimLeft)
  358. s = this.s.trimLeft();
  359. else
  360. s = this.s.replace(/(^\s*)/g, '');
  361. return new this.constructor(s);
  362. },
  363. trimRight: function() {
  364. var s;
  365. if (__nsp.trimRight)
  366. s = this.s.trimRight();
  367. else
  368. s = this.s.replace(/\s+$/, '');
  369. return new this.constructor(s);
  370. },
  371. truncate: function(length, pruneStr) { //from underscore.string, author: github.com/rwz
  372. var str = this.s;
  373. length = ~~length;
  374. pruneStr = pruneStr || '...';
  375. if (str.length <= length) return new this.constructor(str);
  376. var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; },
  377. template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA'
  378. if (template.slice(template.length-2).match(/\w\w/))
  379. template = template.replace(/\s*\S+$/, '');
  380. else
  381. template = new S(template.slice(0, template.length-1)).trimRight().s;
  382. return (template+pruneStr).length > str.length ? new S(str) : new S(str.slice(0, template.length)+pruneStr);
  383. },
  384. toCSV: function() {
  385. var delim = ',', qualifier = '"', escape = '\\', encloseNumbers = true, keys = false;
  386. var dataArray = [];
  387. function hasVal(it) {
  388. return it !== null && it !== '';
  389. }
  390. if (typeof arguments[0] === 'object') {
  391. delim = arguments[0].delimiter || delim;
  392. delim = arguments[0].separator || delim;
  393. qualifier = arguments[0].qualifier || qualifier;
  394. encloseNumbers = !!arguments[0].encloseNumbers;
  395. escape = arguments[0].escape || escape;
  396. keys = !!arguments[0].keys;
  397. } else if (typeof arguments[0] === 'string') {
  398. delim = arguments[0];
  399. }
  400. if (typeof arguments[1] === 'string')
  401. qualifier = arguments[1];
  402. if (arguments[1] === null)
  403. qualifier = null;
  404. if (this.orig instanceof Array)
  405. dataArray = this.orig;
  406. else { //object
  407. for (var key in this.orig)
  408. if (this.orig.hasOwnProperty(key))
  409. if (keys)
  410. dataArray.push(key);
  411. else
  412. dataArray.push(this.orig[key]);
  413. }
  414. var rep = escape + qualifier;
  415. var buildString = [];
  416. for (var i = 0; i < dataArray.length; ++i) {
  417. var shouldQualify = hasVal(qualifier)
  418. if (typeof dataArray[i] == 'number')
  419. shouldQualify &= encloseNumbers;
  420. if (shouldQualify)
  421. buildString.push(qualifier);
  422. if (dataArray[i] !== null && dataArray[i] !== undefined) {
  423. var d = new S(dataArray[i]).replaceAll(qualifier, rep).s;
  424. buildString.push(d);
  425. } else
  426. buildString.push('')
  427. if (shouldQualify)
  428. buildString.push(qualifier);
  429. if (delim)
  430. buildString.push(delim);
  431. }
  432. //chop last delim
  433. //console.log(buildString.length)
  434. buildString.length = buildString.length - 1;
  435. return new this.constructor(buildString.join(''));
  436. },
  437. toString: function() {
  438. return this.s;
  439. },
  440. //#modified from https://github.com/epeli/underscore.string
  441. underscore: function() {
  442. var s = this.trim().s.replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
  443. if ((new S(this.s.charAt(0))).isUpper()) {
  444. s = '_' + s;
  445. }
  446. return new this.constructor(s);
  447. },
  448. unescapeHTML: function() { //from underscore.string
  449. return new this.constructor(this.s.replace(/\&([^;]+);/g, function(entity, entityCode){
  450. var match;
  451. if (entityCode in escapeChars) {
  452. return escapeChars[entityCode];
  453. } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
  454. return String.fromCharCode(parseInt(match[1], 16));
  455. } else if (match = entityCode.match(/^#(\d+)$/)) {
  456. return String.fromCharCode(~~match[1]);
  457. } else {
  458. return entity;
  459. }
  460. }));
  461. },
  462. valueOf: function() {
  463. return this.s.valueOf();
  464. }
  465. }
  466. var methodsAdded = [];
  467. function extendPrototype() {
  468. for (var name in __sp) {
  469. (function(name){
  470. var func = __sp[name];
  471. if (!__nsp.hasOwnProperty(name)) {
  472. methodsAdded.push(name);
  473. __nsp[name] = function() {
  474. String.prototype.s = this;
  475. return func.apply(this, arguments);
  476. }
  477. }
  478. })(name);
  479. }
  480. }
  481. function restorePrototype() {
  482. for (var i = 0; i < methodsAdded.length; ++i)
  483. delete String.prototype[methodsAdded[i]];
  484. methodsAdded.length = 0;
  485. }
  486. /*************************************
  487. /* Attach Native JavaScript String Properties
  488. /*************************************/
  489. var nativeProperties = getNativeStringProperties();
  490. for (var name in nativeProperties) {
  491. (function(name) {
  492. var stringProp = __nsp[name];
  493. if (typeof stringProp == 'function') {
  494. //console.log(stringProp)
  495. if (!__sp[name]) {
  496. if (nativeProperties[name] === 'string') {
  497. __sp[name] = function() {
  498. //console.log(name)
  499. return new this.constructor(stringProp.apply(this, arguments));
  500. }
  501. } else {
  502. __sp[name] = stringProp;
  503. }
  504. }
  505. }
  506. })(name);
  507. }
  508. /*************************************
  509. /* Function Aliases
  510. /*************************************/
  511. __sp.repeat = __sp.times;
  512. __sp.include = __sp.contains;
  513. __sp.toInteger = __sp.toInt;
  514. __sp.toBool = __sp.toBoolean;
  515. __sp.decodeHTMLEntities = __sp.decodeHtmlEntities //ensure consistent casing scheme of 'HTML'
  516. //******************************************************************************
  517. // Set the constructor. Without this, string.js objects are instances of
  518. // Object instead of S.
  519. //******************************************************************************
  520. __sp.constructor = S;
  521. /*************************************
  522. /* Private Functions
  523. /*************************************/
  524. function getNativeStringProperties() {
  525. var names = getNativeStringPropertyNames();
  526. var retObj = {};
  527. for (var i = 0; i < names.length; ++i) {
  528. var name = names[i];
  529. var func = __nsp[name];
  530. try {
  531. var type = typeof func.apply('teststring', []);
  532. retObj[name] = type;
  533. } catch (e) {}
  534. }
  535. return retObj;
  536. }
  537. function getNativeStringPropertyNames() {
  538. var results = [];
  539. if (Object.getOwnPropertyNames) {
  540. results = Object.getOwnPropertyNames(__nsp);
  541. results.splice(results.indexOf('valueOf'), 1);
  542. results.splice(results.indexOf('toString'), 1);
  543. return results;
  544. } else { //meant for legacy cruft, this could probably be made more efficient
  545. var stringNames = {};
  546. var objectNames = [];
  547. for (var name in String.prototype)
  548. stringNames[name] = name;
  549. for (var name in Object.prototype)
  550. delete stringNames[name];
  551. //stringNames['toString'] = 'toString'; //this was deleted with the rest of the object names
  552. for (var name in stringNames) {
  553. results.push(name);
  554. }
  555. return results;
  556. }
  557. }
  558. function Export(str) {
  559. return new S(str);
  560. };
  561. //attach exports to StringJSWrapper
  562. Export.extendPrototype = extendPrototype;
  563. Export.restorePrototype = restorePrototype;
  564. Export.VERSION = VERSION;
  565. Export.TMPL_OPEN = '{{';
  566. Export.TMPL_CLOSE = '}}';
  567. Export.ENTITIES = ENTITIES;
  568. /*************************************
  569. /* Exports
  570. /*************************************/
  571. if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
  572. module.exports = Export;
  573. } else {
  574. if(typeof define === "function" && define.amd) {
  575. define([], function() {
  576. return Export;
  577. });
  578. } else {
  579. window.S = Export;
  580. }
  581. }
  582. /*************************************
  583. /* 3rd Party Private Functions
  584. /*************************************/
  585. //from sugar.js
  586. function multiArgs(args, fn) {
  587. var result = [], i;
  588. for(i = 0; i < args.length; i++) {
  589. result.push(args[i]);
  590. if(fn) fn.call(args, args[i], i);
  591. }
  592. return result;
  593. }
  594. //from underscore.string
  595. var escapeChars = {
  596. lt: '<',
  597. gt: '>',
  598. quot: '"',
  599. apos: "'",
  600. amp: '&'
  601. };
  602. //from underscore.string
  603. var reversedEscapeChars = {};
  604. for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; }
  605. ENTITIES = {
  606. "amp" : "&",
  607. "gt" : ">",
  608. "lt" : "<",
  609. "quot" : "\"",
  610. "apos" : "'",
  611. "AElig" : 198,
  612. "Aacute" : 193,
  613. "Acirc" : 194,
  614. "Agrave" : 192,
  615. "Aring" : 197,
  616. "Atilde" : 195,
  617. "Auml" : 196,
  618. "Ccedil" : 199,
  619. "ETH" : 208,
  620. "Eacute" : 201,
  621. "Ecirc" : 202,
  622. "Egrave" : 200,
  623. "Euml" : 203,
  624. "Iacute" : 205,
  625. "Icirc" : 206,
  626. "Igrave" : 204,
  627. "Iuml" : 207,
  628. "Ntilde" : 209,
  629. "Oacute" : 211,
  630. "Ocirc" : 212,
  631. "Ograve" : 210,
  632. "Oslash" : 216,
  633. "Otilde" : 213,
  634. "Ouml" : 214,
  635. "THORN" : 222,
  636. "Uacute" : 218,
  637. "Ucirc" : 219,
  638. "Ugrave" : 217,
  639. "Uuml" : 220,
  640. "Yacute" : 221,
  641. "aacute" : 225,
  642. "acirc" : 226,
  643. "aelig" : 230,
  644. "agrave" : 224,
  645. "aring" : 229,
  646. "atilde" : 227,
  647. "auml" : 228,
  648. "ccedil" : 231,
  649. "eacute" : 233,
  650. "ecirc" : 234,
  651. "egrave" : 232,
  652. "eth" : 240,
  653. "euml" : 235,
  654. "iacute" : 237,
  655. "icirc" : 238,
  656. "igrave" : 236,
  657. "iuml" : 239,
  658. "ntilde" : 241,
  659. "oacute" : 243,
  660. "ocirc" : 244,
  661. "ograve" : 242,
  662. "oslash" : 248,
  663. "otilde" : 245,
  664. "ouml" : 246,
  665. "szlig" : 223,
  666. "thorn" : 254,
  667. "uacute" : 250,
  668. "ucirc" : 251,
  669. "ugrave" : 249,
  670. "uuml" : 252,
  671. "yacute" : 253,
  672. "yuml" : 255,
  673. "copy" : 169,
  674. "reg" : 174,
  675. "nbsp" : 160,
  676. "iexcl" : 161,
  677. "cent" : 162,
  678. "pound" : 163,
  679. "curren" : 164,
  680. "yen" : 165,
  681. "brvbar" : 166,
  682. "sect" : 167,
  683. "uml" : 168,
  684. "ordf" : 170,
  685. "laquo" : 171,
  686. "not" : 172,
  687. "shy" : 173,
  688. "macr" : 175,
  689. "deg" : 176,
  690. "plusmn" : 177,
  691. "sup1" : 185,
  692. "sup2" : 178,
  693. "sup3" : 179,
  694. "acute" : 180,
  695. "micro" : 181,
  696. "para" : 182,
  697. "middot" : 183,
  698. "cedil" : 184,
  699. "ordm" : 186,
  700. "raquo" : 187,
  701. "frac14" : 188,
  702. "frac12" : 189,
  703. "frac34" : 190,
  704. "iquest" : 191,
  705. "times" : 215,
  706. "divide" : 247,
  707. "OElig;" : 338,
  708. "oelig;" : 339,
  709. "Scaron;" : 352,
  710. "scaron;" : 353,
  711. "Yuml;" : 376,
  712. "fnof;" : 402,
  713. "circ;" : 710,
  714. "tilde;" : 732,
  715. "Alpha;" : 913,
  716. "Beta;" : 914,
  717. "Gamma;" : 915,
  718. "Delta;" : 916,
  719. "Epsilon;" : 917,
  720. "Zeta;" : 918,
  721. "Eta;" : 919,
  722. "Theta;" : 920,
  723. "Iota;" : 921,
  724. "Kappa;" : 922,
  725. "Lambda;" : 923,
  726. "Mu;" : 924,
  727. "Nu;" : 925,
  728. "Xi;" : 926,
  729. "Omicron;" : 927,
  730. "Pi;" : 928,
  731. "Rho;" : 929,
  732. "Sigma;" : 931,
  733. "Tau;" : 932,
  734. "Upsilon;" : 933,
  735. "Phi;" : 934,
  736. "Chi;" : 935,
  737. "Psi;" : 936,
  738. "Omega;" : 937,
  739. "alpha;" : 945,
  740. "beta;" : 946,
  741. "gamma;" : 947,
  742. "delta;" : 948,
  743. "epsilon;" : 949,
  744. "zeta;" : 950,
  745. "eta;" : 951,
  746. "theta;" : 952,
  747. "iota;" : 953,
  748. "kappa;" : 954,
  749. "lambda;" : 955,
  750. "mu;" : 956,
  751. "nu;" : 957,
  752. "xi;" : 958,
  753. "omicron;" : 959,
  754. "pi;" : 960,
  755. "rho;" : 961,
  756. "sigmaf;" : 962,
  757. "sigma;" : 963,
  758. "tau;" : 964,
  759. "upsilon;" : 965,
  760. "phi;" : 966,
  761. "chi;" : 967,
  762. "psi;" : 968,
  763. "omega;" : 969,
  764. "thetasym;" : 977,
  765. "upsih;" : 978,
  766. "piv;" : 982,
  767. "ensp;" : 8194,
  768. "emsp;" : 8195,
  769. "thinsp;" : 8201,
  770. "zwnj;" : 8204,
  771. "zwj;" : 8205,
  772. "lrm;" : 8206,
  773. "rlm;" : 8207,
  774. "ndash;" : 8211,
  775. "mdash;" : 8212,
  776. "lsquo;" : 8216,
  777. "rsquo;" : 8217,
  778. "sbquo;" : 8218,
  779. "ldquo;" : 8220,
  780. "rdquo;" : 8221,
  781. "bdquo;" : 8222,
  782. "dagger;" : 8224,
  783. "Dagger;" : 8225,
  784. "bull;" : 8226,
  785. "hellip;" : 8230,
  786. "permil;" : 8240,
  787. "prime;" : 8242,
  788. "Prime;" : 8243,
  789. "lsaquo;" : 8249,
  790. "rsaquo;" : 8250,
  791. "oline;" : 8254,
  792. "frasl;" : 8260,
  793. "euro;" : 8364,
  794. "image;" : 8465,
  795. "weierp;" : 8472,
  796. "real;" : 8476,
  797. "trade;" : 8482,
  798. "alefsym;" : 8501,
  799. "larr;" : 8592,
  800. "uarr;" : 8593,
  801. "rarr;" : 8594,
  802. "darr;" : 8595,
  803. "harr;" : 8596,
  804. "crarr;" : 8629,
  805. "lArr;" : 8656,
  806. "uArr;" : 8657,
  807. "rArr;" : 8658,
  808. "dArr;" : 8659,
  809. "hArr;" : 8660,
  810. "forall;" : 8704,
  811. "part;" : 8706,
  812. "exist;" : 8707,
  813. "empty;" : 8709,
  814. "nabla;" : 8711,
  815. "isin;" : 8712,
  816. "notin;" : 8713,
  817. "ni;" : 8715,
  818. "prod;" : 8719,
  819. "sum;" : 8721,
  820. "minus;" : 8722,
  821. "lowast;" : 8727,
  822. "radic;" : 8730,
  823. "prop;" : 8733,
  824. "infin;" : 8734,
  825. "ang;" : 8736,
  826. "and;" : 8743,
  827. "or;" : 8744,
  828. "cap;" : 8745,
  829. "cup;" : 8746,
  830. "int;" : 8747,
  831. "there4;" : 8756,
  832. "sim;" : 8764,
  833. "cong;" : 8773,
  834. "asymp;" : 8776,
  835. "ne;" : 8800,
  836. "equiv;" : 8801,
  837. "le;" : 8804,
  838. "ge;" : 8805,
  839. "sub;" : 8834,
  840. "sup;" : 8835,
  841. "nsub;" : 8836,
  842. "sube;" : 8838,
  843. "supe;" : 8839,
  844. "oplus;" : 8853,
  845. "otimes;" : 8855,
  846. "perp;" : 8869,
  847. "sdot;" : 8901,
  848. "lceil;" : 8968,
  849. "rceil;" : 8969,
  850. "lfloor;" : 8970,
  851. "rfloor;" : 8971,
  852. "lang;" : 9001,
  853. "rang;" : 9002,
  854. "loz;" : 9674,
  855. "spades;" : 9824,
  856. "clubs;" : 9827,
  857. "hearts;" : 9829,
  858. "diams;" : 9830
  859. }
  860. }).call(this);