add math words
Browse files- handler.py +2 -2
- utils.py +421 -0
handler.py
CHANGED
@@ -378,8 +378,8 @@ def load_math_terms():
|
|
378 |
math_terms_dict = {}
|
379 |
for term in MATH_WORDS:
|
380 |
if term in MATH_PREFIXES:
|
381 |
-
math_terms_dict[f"(^|[^a-zA-Z]){term}(s|es)?([^a-zA-Z]|$)"] = term
|
382 |
-
math_terms.append(f"(^|[^a-zA-Z]){term}(s|es)?([^a-zA-Z]|$)")
|
383 |
else:
|
384 |
math_terms.append(term)
|
385 |
math_terms_dict[term] = term
|
|
|
378 |
math_terms_dict = {}
|
379 |
for term in MATH_WORDS:
|
380 |
if term in MATH_PREFIXES:
|
381 |
+
math_terms_dict[f"(^|[^a-zA-Z]){term}(s|es|d|ed)?([^a-zA-Z]|$)"] = term
|
382 |
+
math_terms.append(f"(^|[^a-zA-Z]){term}(s|es|d|ed)?([^a-zA-Z]|$)")
|
383 |
else:
|
384 |
math_terms.append(term)
|
385 |
math_terms_dict[term] = term
|
utils.py
CHANGED
@@ -295,6 +295,427 @@ MATH_WORDS = [
|
|
295 |
"unit rate",
|
296 |
"variability",
|
297 |
"variable",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
]
|
299 |
|
300 |
def get_num_words(text):
|
|
|
295 |
"unit rate",
|
296 |
"variability",
|
297 |
"variable",
|
298 |
+
"abundant number",
|
299 |
+
"accurate",
|
300 |
+
"acre",
|
301 |
+
"addition fact",
|
302 |
+
"algebraic",
|
303 |
+
"altitude",
|
304 |
+
"apex",
|
305 |
+
"arithmetic facts",
|
306 |
+
"associative property",
|
307 |
+
"astronomical unit",
|
308 |
+
"base",
|
309 |
+
"baseline",
|
310 |
+
"billion",
|
311 |
+
"celsius",
|
312 |
+
"census",
|
313 |
+
"cent",
|
314 |
+
"center of a circle",
|
315 |
+
"center of a sphere",
|
316 |
+
"chance",
|
317 |
+
"circle graph",
|
318 |
+
"column",
|
319 |
+
"combine",
|
320 |
+
"common fraction",
|
321 |
+
"comparison diagram",
|
322 |
+
"comparison story",
|
323 |
+
"compass",
|
324 |
+
"complement",
|
325 |
+
"concave polygon",
|
326 |
+
"concentric circles",
|
327 |
+
"consecutive",
|
328 |
+
"constant",
|
329 |
+
"continuous model of area",
|
330 |
+
"continuous model of volume",
|
331 |
+
"contour",
|
332 |
+
"conversion fact",
|
333 |
+
"convex polygon",
|
334 |
+
"counting numbers",
|
335 |
+
"counting up subtraction",
|
336 |
+
"cover-up method",
|
337 |
+
"cross multiplication",
|
338 |
+
"cubic",
|
339 |
+
"cubit",
|
340 |
+
"curved surface",
|
341 |
+
"cylinder",
|
342 |
+
"decagon",
|
343 |
+
"decimeter",
|
344 |
+
"deficient number",
|
345 |
+
"density",
|
346 |
+
"discrete model",
|
347 |
+
"displacement method",
|
348 |
+
"divisibility test",
|
349 |
+
"divisible by",
|
350 |
+
"dodecahedron",
|
351 |
+
"double stem plot",
|
352 |
+
"doubles fact",
|
353 |
+
"egyptian multiplication",
|
354 |
+
"elevation",
|
355 |
+
"embed figure",
|
356 |
+
"end point",
|
357 |
+
"enlarge",
|
358 |
+
"equal",
|
359 |
+
"equal groups",
|
360 |
+
"equal parts",
|
361 |
+
"equidistant marks",
|
362 |
+
"equilateral polygon",
|
363 |
+
"equivalent fractions",
|
364 |
+
"european subtraction",
|
365 |
+
"expanded notation",
|
366 |
+
"expected outcome",
|
367 |
+
"exponential",
|
368 |
+
"extended facts",
|
369 |
+
"fact power",
|
370 |
+
"fact triangle",
|
371 |
+
"factor",
|
372 |
+
"factors of numbers",
|
373 |
+
"fahrenheit",
|
374 |
+
"false number sentence",
|
375 |
+
"figurate numbers",
|
376 |
+
"flowchart",
|
377 |
+
"fluid ounce",
|
378 |
+
"fractional part",
|
379 |
+
"fulcrum",
|
380 |
+
"function machine",
|
381 |
+
"furlong",
|
382 |
+
"genus",
|
383 |
+
"geoboard",
|
384 |
+
"geometric solid",
|
385 |
+
"geometry template",
|
386 |
+
"girth",
|
387 |
+
"golden ratio",
|
388 |
+
"golden rectangle",
|
389 |
+
"graph key",
|
390 |
+
"grouping symbol",
|
391 |
+
"hemisphere",
|
392 |
+
"icosahedron",
|
393 |
+
"improper fraction",
|
394 |
+
"inch",
|
395 |
+
"index of locations",
|
396 |
+
"indirect measurement",
|
397 |
+
"input",
|
398 |
+
"inscribed polygon",
|
399 |
+
"instance of a pattern",
|
400 |
+
"interior of a figure",
|
401 |
+
"interpolate",
|
402 |
+
"irrational",
|
403 |
+
"isometry transformation",
|
404 |
+
"isosceles trapezoid",
|
405 |
+
"juxtapose",
|
406 |
+
"key sequence",
|
407 |
+
"label",
|
408 |
+
"landmark",
|
409 |
+
"latitude",
|
410 |
+
"lattice multiplication",
|
411 |
+
"left to right subtraction",
|
412 |
+
"leg of a right triangle",
|
413 |
+
"like terms",
|
414 |
+
"line graph",
|
415 |
+
"line of reflection",
|
416 |
+
"line of symmetry",
|
417 |
+
"line symmetry",
|
418 |
+
"lines of latitude",
|
419 |
+
"lines of longitude",
|
420 |
+
"longitude",
|
421 |
+
"magnitude estimate",
|
422 |
+
"map legend",
|
423 |
+
"map scale",
|
424 |
+
"maximum",
|
425 |
+
"measurement division",
|
426 |
+
"measurement unit",
|
427 |
+
"meridian bar",
|
428 |
+
"metric system",
|
429 |
+
"midpoint",
|
430 |
+
"mile",
|
431 |
+
"millisecond",
|
432 |
+
"minimum",
|
433 |
+
"minuend",
|
434 |
+
"mirror image",
|
435 |
+
"mobius",
|
436 |
+
"modal",
|
437 |
+
"multiplication counting principle",
|
438 |
+
"multiplication diagram",
|
439 |
+
"multiplication fact",
|
440 |
+
"multiplication symbols",
|
441 |
+
"multiplication use class",
|
442 |
+
"negative rational numbers",
|
443 |
+
"nested parentheses",
|
444 |
+
"net score",
|
445 |
+
"net weight",
|
446 |
+
"nonagon",
|
447 |
+
"nonconvex polygon",
|
448 |
+
"normal span",
|
449 |
+
"number grid",
|
450 |
+
"number sequence",
|
451 |
+
"numeral",
|
452 |
+
"numeration",
|
453 |
+
"octahedron",
|
454 |
+
"open proportion",
|
455 |
+
"operation",
|
456 |
+
"operation symbol",
|
457 |
+
"opposite angle",
|
458 |
+
"opposite change rule",
|
459 |
+
"opposite of a number",
|
460 |
+
"opposite side",
|
461 |
+
"order of magnitude",
|
462 |
+
"order of operations",
|
463 |
+
"order of rotation symmetry",
|
464 |
+
"ordinal number",
|
465 |
+
"pan balance",
|
466 |
+
"parabola",
|
467 |
+
"parallel lines",
|
468 |
+
"parallel planes",
|
469 |
+
"part to part ratio",
|
470 |
+
"part to whole ratio",
|
471 |
+
"part whole fraction",
|
472 |
+
"partial differences subtraction",
|
473 |
+
"partial products multiplication",
|
474 |
+
"partial quotients division",
|
475 |
+
"partial sums addition",
|
476 |
+
"partitive division",
|
477 |
+
"parts and total diagram",
|
478 |
+
"per capita",
|
479 |
+
"per unit rate",
|
480 |
+
"percent circle",
|
481 |
+
"perfect number",
|
482 |
+
"perpetual calendar",
|
483 |
+
"pie graph",
|
484 |
+
"plane",
|
485 |
+
"plane figure",
|
486 |
+
"point symmetry",
|
487 |
+
"population density",
|
488 |
+
"precise",
|
489 |
+
"predict",
|
490 |
+
"prediction line",
|
491 |
+
"preimage",
|
492 |
+
"prime factorization",
|
493 |
+
"prime meridian",
|
494 |
+
"probability",
|
495 |
+
"probability meter",
|
496 |
+
"probability tree diagram",
|
497 |
+
"proper factor",
|
498 |
+
"proper fraction",
|
499 |
+
"property",
|
500 |
+
"quadrangle",
|
501 |
+
"quick common denominator",
|
502 |
+
"quotitive division",
|
503 |
+
"random draw",
|
504 |
+
"random experiment",
|
505 |
+
"random number",
|
506 |
+
"random sample",
|
507 |
+
"rank",
|
508 |
+
"rate diagram",
|
509 |
+
"rate multiplication ",
|
510 |
+
"rate unit",
|
511 |
+
"recall survey",
|
512 |
+
"rectangular array",
|
513 |
+
"rectangular coordinate grid",
|
514 |
+
"rectangular prism",
|
515 |
+
"rectangular pyramid",
|
516 |
+
"rectilinear figure",
|
517 |
+
"reflection",
|
518 |
+
"reflex angle",
|
519 |
+
"regular polyhedron",
|
520 |
+
"regular tessellation",
|
521 |
+
"relation symbol",
|
522 |
+
"revolution",
|
523 |
+
"right cone",
|
524 |
+
"right cylinder",
|
525 |
+
"right prism",
|
526 |
+
"right pyramid",
|
527 |
+
"right triangle",
|
528 |
+
"roman numerals",
|
529 |
+
"rotation symmetry",
|
530 |
+
"same change rule for subtraction",
|
531 |
+
"scale model",
|
532 |
+
"scale of a map",
|
533 |
+
"scale of a number line",
|
534 |
+
"sector",
|
535 |
+
"segment",
|
536 |
+
"sequence",
|
537 |
+
"significant digits",
|
538 |
+
"similar figures",
|
539 |
+
"simpler form",
|
540 |
+
"situtation diagram",
|
541 |
+
"skew lines",
|
542 |
+
"slanted",
|
543 |
+
"slide rule",
|
544 |
+
"span",
|
545 |
+
"stacked bar graph",
|
546 |
+
"standard unit",
|
547 |
+
"stem and leaf plot",
|
548 |
+
"step graph",
|
549 |
+
"straightedge",
|
550 |
+
"substitute",
|
551 |
+
"subtrahend",
|
552 |
+
"surface",
|
553 |
+
"symmetric",
|
554 |
+
"tally",
|
555 |
+
"tangent",
|
556 |
+
"tangent circles",
|
557 |
+
"temperature",
|
558 |
+
"template",
|
559 |
+
"tetrahedron",
|
560 |
+
"theorem",
|
561 |
+
"tile",
|
562 |
+
"tiling",
|
563 |
+
"time graph",
|
564 |
+
"timeline",
|
565 |
+
"top heavy fraction",
|
566 |
+
"topological",
|
567 |
+
"topology",
|
568 |
+
"trade first subtraction",
|
569 |
+
"tree diagram",
|
570 |
+
"triangular",
|
571 |
+
"true number sentence",
|
572 |
+
"truncate",
|
573 |
+
"twin primes",
|
574 |
+
"unlike denominators",
|
575 |
+
"unlike fractions",
|
576 |
+
"vanishing ",
|
577 |
+
"venn diagram",
|
578 |
+
"vernal equinox",
|
579 |
+
"weight",
|
580 |
+
"width",
|
581 |
+
"base of a prism",
|
582 |
+
"base of a pyramid",
|
583 |
+
"face",
|
584 |
+
"numerical data",
|
585 |
+
"opposite",
|
586 |
+
"pace",
|
587 |
+
"per",
|
588 |
+
"region",
|
589 |
+
"sign",
|
590 |
+
"alternate interior angles",
|
591 |
+
"base of an exponent",
|
592 |
+
"cone",
|
593 |
+
"congruent",
|
594 |
+
"counterclockwise",
|
595 |
+
"cube root",
|
596 |
+
"hypotenuse",
|
597 |
+
"irrational number",
|
598 |
+
"linear relationship",
|
599 |
+
"positive association",
|
600 |
+
"rate of change",
|
601 |
+
"translation",
|
602 |
+
"transversal",
|
603 |
+
"circumference",
|
604 |
+
"corresponding",
|
605 |
+
"expand",
|
606 |
+
"population",
|
607 |
+
"proportion",
|
608 |
+
"radius",
|
609 |
+
"random",
|
610 |
+
"repeating decimal",
|
611 |
+
"representative",
|
612 |
+
"scaled",
|
613 |
+
"withdrawal",
|
614 |
+
"center",
|
615 |
+
"edge",
|
616 |
+
"height of a parallelogram or triangle",
|
617 |
+
"net",
|
618 |
+
"speed",
|
619 |
+
"table",
|
620 |
+
"term",
|
621 |
+
"adjacent",
|
622 |
+
"complementary",
|
623 |
+
"cross-section",
|
624 |
+
"cross section",
|
625 |
+
"deposit",
|
626 |
+
"event",
|
627 |
+
"measurement error",
|
628 |
+
"proportional",
|
629 |
+
"simulation",
|
630 |
+
"center of a dilation",
|
631 |
+
"clockwise",
|
632 |
+
"dilation",
|
633 |
+
"function",
|
634 |
+
"negative association",
|
635 |
+
"pythagorean theorem",
|
636 |
+
"relative frequency",
|
637 |
+
"rigid transformation",
|
638 |
+
"scale factor",
|
639 |
+
"scatter plot",
|
640 |
+
"similar",
|
641 |
+
"sphere",
|
642 |
+
"two-way table",
|
643 |
+
"additive identity",
|
644 |
+
"additive inverse",
|
645 |
+
"box and whisker plot",
|
646 |
+
"cartesian coordinates",
|
647 |
+
"central angle",
|
648 |
+
"chord",
|
649 |
+
"combination",
|
650 |
+
"commutative property",
|
651 |
+
"coplanar",
|
652 |
+
"cross product",
|
653 |
+
"dependent events",
|
654 |
+
"difference",
|
655 |
+
"dividend",
|
656 |
+
"equilateral triangle",
|
657 |
+
"error of measurement",
|
658 |
+
"factorial",
|
659 |
+
"formula",
|
660 |
+
"identity property of",
|
661 |
+
"independent events",
|
662 |
+
"infinity",
|
663 |
+
"inscribed angle",
|
664 |
+
"intercept",
|
665 |
+
"intercepted arc",
|
666 |
+
"inverse",
|
667 |
+
"inverse operations",
|
668 |
+
"isosceles triangle",
|
669 |
+
"least common denominator",
|
670 |
+
"like fractions",
|
671 |
+
"locus",
|
672 |
+
"logic",
|
673 |
+
"lowest terms",
|
674 |
+
"mode",
|
675 |
+
"multiplicative identity",
|
676 |
+
"multiplicative inverse",
|
677 |
+
"mutually exclusive events",
|
678 |
+
"natural numbers",
|
679 |
+
"normal",
|
680 |
+
"permutation",
|
681 |
+
"pi",
|
682 |
+
"point",
|
683 |
+
"power",
|
684 |
+
"range",
|
685 |
+
"rate",
|
686 |
+
"ray",
|
687 |
+
"real numbers",
|
688 |
+
"rectangular",
|
689 |
+
"root",
|
690 |
+
"rotation",
|
691 |
+
"scalene triangle",
|
692 |
+
"scattergram",
|
693 |
+
"set",
|
694 |
+
"statistics",
|
695 |
+
"terminating decimal",
|
696 |
+
"transformation",
|
697 |
+
"x intercept",
|
698 |
+
"x-axis",
|
699 |
+
"x-intercept",
|
700 |
+
"y intercept",
|
701 |
+
"y-axis",
|
702 |
+
"y-intercept",
|
703 |
+
"zero",
|
704 |
+
"zero property of multiplication",
|
705 |
+
"base of a parallelogram",
|
706 |
+
"base of a triangle",
|
707 |
+
"height",
|
708 |
+
"chance experiment",
|
709 |
+
"diameter",
|
710 |
+
"mean",
|
711 |
+
"percentage",
|
712 |
+
"sample",
|
713 |
+
"legs",
|
714 |
+
"outlier",
|
715 |
+
"slope",
|
716 |
+
"square root",
|
717 |
+
"system of equations",
|
718 |
+
"tessellation",
|
719 |
]
|
720 |
|
721 |
def get_num_words(text):
|