Refactor ngram normalization

parent 16138dfa
dev 110-ngrams-table-adding-new-ngrams 114-ngrams-table-search-ngrams 142-ngramstable 145-dev-editor-codetype-change-from-md-to-json 149-dev-ngrams-table-sorting-fix 155-dev-export-list-as-csv 164-dev-node-write-analysis 169-dev-uniqid-removal 174-dev-add-document-rc0.x 174-dev-add-document-rc1.x 174-dev-add-document-rc2.x 174-dev-add-document-rc3.x 174-dev-add-document-rc4.x 181-ui-tree-expander-icon 181-ui-tree-expander-icon-2 184-dev-nlp-languages 201-dev-user-api-key-for-pubmed 203-dev-corpus-json-upload 204-ngrams-refactor-fixes 206-dev-phylo-fixes 208-dev-phylo-search-improvements 209-doc-annotation-discrepency-between-local-map-list-and-global-maplist 21-dev-automated-tests 213-dev-node-user 213-dev-node-user-temp 217-dev-ngrams-sync-fix 219-memiescape-rc0.x 219-memiescape-rc1.x 224-dev-uniform-ngrams-creation 228-doc-annotation-multiterms 234-dev-ngrams-score 240-dev-graph-node-name-not-clickable-when-empty 240-dev-node-graph-disable-when-needs-refresh 242-dev-phylo-search-documents 243-dev-graph-explorer-link-filtering 262-dev-phylo-doc-search-ux-improvements 270-dev-fix-themes 272-dev-docs-table-score 272-dev-folder-view 273-dev-iframe-styling 274-dev-login-page-advanced 278-dev-folder-view-home 279-dev-folder-view-action-capability 280-dev-back-from-other-views 286-dev-css-fix-for-graph-height 287-dev-doc-annotation-menu 288-dev-folders-for-all-sessions 289-dev-graph-view-refresh 290-dev-design-ergo-tree-closed-node 290-dev-folder-icons-fix 291-dev-dashboard-parent-id-fix 294-dev-test 296-dev-tree-refresh-from-folders 298-dev-show-tree-in-all-views 300-dev-purescript-simple-json 301-dev-visio-integration 302-dev-access-box-node-tree-rc1.x 303-dev-chart-doc-interaction-rc1.x 303-dev-chart-doc-interaction-rc2.x 304-dev-force-atlas-flickering-fix 305-dev-sidebar-fixes 305-optim-docs-view-doc 307-dev-improve-darkster 308-dev-node-visibility-rc3.x 308-dev-order2 308-dev-subtree-folded-rc0.1 308-dev-subtree-folded-rc0.x 308-dev-subtree-folded-rc1.x 308-dev-subtree-folded-rc2.x 309-dev-chromium-condition-rc1.x 309-dev-node-icon-rc1.x 309-dev-node-icon-rc2.x 309-dev-node-icon-rc3.x 309-dev-node-icon-rc4.x 309-dev-node-icon-rc5.x 309-tree-node-add-new-node-better-suggestion 310-dev-frontend-lang 311-tree-node-list-upload-file-as-json 312-dev-export-as-zip-file 312-dev-merge-docs-blank-page 312-dev-merge-docs-blank-page-rc2.x 313-dev-popup-scroll-rc1.x 313-dev-ui-enhancement-rc1.1 313-dev-ui-enhancement-rc1.2 313-dev-ui-enhancement-rc1.3 313-dev-ui-enhancement-rc1.4 313-dev-ui-enhancement-rc1.x 314-dev-ui-enhancement-rc3.x 318-dev-corpus-fields-editeable 319-dev-input-focus-lost-on-search 322-dev-list-ids-selection 323-dev-fix-node-update-serialization 323-dev-user-email-validation 324-dev-popup-close-ui-rc0.x 326-dev-invitation-error 327-dev-async-task-fix 328-dev-document-view-filter-fix-for-cache-on-off 330-dev-minify 331-dev-corpora-from-write-nodes 332-dev-bootstrap-downgrade-rc0.x 333-dev-graph-darkster-theme-rc0.x 333-dev-graph-darkster-theme-rc1.x 333-dev-graph-darkster-theme-rc2.x 334-dev-side-document-view-rc0.x 334-dev-side-document-view-rc1.x 338-dev-csv-maplist-from-gargv3 339-dev-corpus-download 339-dev-docs-download 340-dev-ngrams-tab-rc0.x 340-dev-ngrams-tab-rc1.x 340-search-in-ngrams-table 341-dev-fix-build-instructions 342-dev-corpus-upload-loader-rc0.x 343-dev-gargantext-navigation 344-dev-fix-ngrams-search-for-multi-terms 347-dev-search-enter-fix 349-dev-tag-cloud-in-graph-explorer 350-dev-graph-search-in-forms-not-labels 351-dev-remove-reset-force-atlas-button 352-dev-tag-cloud-duplicated-fix 354-dev-graph-screenshot-fix 358-dev-add-button-fix-when-table-not-empty 359-dev-input-with-autocomplete 360-dev-batch-tagging-fix 360-dev-css-cleaning-rc0.x 362-dev-sqlite 362-dev-visio-frame 364-dev-graph-search-rc0.x 365-dev-graphql-folders 366-dev-nodetype-creation 367-dev-cache-search-rc0.x 369-dev-forest-tooltip 371-dev-user-profile 375-dev-docs-focus-rc0.x 375-dev-docs-focus-rc1.x 375-dev-docs-focus-rc3.x 375-dev-docs-focus-rc6.x 375-dev-docs-focus-rc7.x 375-dev-phylo-docs-rc0.x 376-dev-annuaire-contacts-page 376-dev-annuaire-debug-rc0.x 376-dev-annuaire-debug-rc1.x 376-dev-annuaire-debug-rc2.x 376-dev-annuaire-fields-fix 377-dev-fonts-terms-rc0.x 378-dev-add-sync-ngram-rc0.x 379-dev-sidebar-ui-rc0.x 379-dev-sidebar-ui-rc1.x 379-dev-sidebar-ui-rc2.x 379-dev-sidebar-ui-rc3.x 379-dev-sidebar-ui-rc4.x 379-dev-sidebar-ui-rc5.x 381-dev-graph-legend-rc0.x 381-dev-graph-legend-rc1.x 382-dev-plane-navigation 383-dev-docs-chart-update 386-387-392-dev-ui-ux-rc0.x 386-387-dev-ui-ux-rc0.x 387-dev-notebook-ui-rc0.x 391-dev-table-state 393-dev-mouse-alignment-rc0.x 395-dev-ps-0.15-update 396-dev-list-persons-in-team 397-dev-lost-password 399-dev-multiple-trees-rc0.x 401-dev-css-frame-rc0.x 403-dev-config-cache-rc0.x 404-dev-popover-close-button-fix 405-dev-lost-password-design 406-dev-board-source-rc0.x 407-dev-doc-highlighting-rc0.x 408-dev-ngrams-phylo-rc0.x 408-dev-ngrams-phylo-rc1.x 409-dev-ngrams-table-edit-and-search 410-dev-document-null-id 412-dev-graph-explorer-self-referencing-node 414-dev-nested-ngrams-rc0.x 414-dev-nested-ngrams-rc1.x 415-dev-user-description-field 416-dev-ngrams-table-search 418-dev-louvain-clustering-on-filtered-graph 419-dev-ngrams-cache-on-rc0.x 419-dev-ngrams-cache-on-rc1.x 420-dev-document-css-rc0.x 422-dev-resize-handler-rc0.x 423-dev-no-term-mode-rc0.x 423-dev-no-term-mode-rc1.x 424-dev-selected-node-rc0.x 425-dev-terms-page-reset 427-dev-modal-improvement-rc0.x 427-dev-modal-improvement-rc1.x 427-dev-modal-improvement-rc2.x 427-dev-modal-improvement-rc3.x 428-dev-profile-img-upload 429-dev-login-advanced 430-dev-doc-histogram 431-dev-lost-password-email 432-dev-modal-deactivation-rc0.x 432-dev-modal-deactivation-rc1.x 434-modal-with-chrome-browser 438-dev-team-node-creator 440-dev-maplist-modal-rc0.x 441-dev-ngrams-table-sorting-fix 445-dev-doc-upload-language 446-dev-cache-cta-rc0.x 447-448-dev-merge-rc0.x 447-448-dev-merge-rc1.x 447-dev-block-edition-rc0.x 447-dev-block-edition-rc1.x 449-dev-docs-histo-selected 450-dev-filter-histo-multiple-dates 451-dev-disable-controls-when-forceatlas-is-running 452-dev-teams-security 453-dev-false-occurrence-count-fix 454-dev-fix-graphology-edge-ids 456-dev-doc-annotation-rc0.x 458-dev-dont-allow-spaces-in-doc-annotation-selection 459-dev-graph-fixes 460-dev-graph-toolbar-rc0.x 461-dev-popup-darkmode-rc0.x 462-missing-default-list-error 463-dev-doc-edit 464-dev-disconnection-issue-rc0.x 464-dev-disconnection-issue-rc1.x 465-dev-graph-explorer-recursion-error 468-dev-ngrams-order-by 471-dev-graph-node-hidden-rc0.x 471-dev-graph-node-hidden-rc1.x 475-dev-node-team-invite 476-dev-rest-error-when-adding-ngrams 480-dev-corpus-upload-list-selection 481-dev-node-calc-upload 489-dev-graph-explorer-fixes 489-dev-grapshot-fixes 496-graph-explorer-regressions 497-dev-node-write-selection 498-dev-invite-many 500-dev-limit-on-text-length-too-small-fix 501-dev-label-shape-in-graph-explorer 506-dev-search-in-tree 509-improve-global-theme 509-improve-global-theme-2 510-dev-textflow-node-progress-bar 511-tree-on-the-right 513-dev-pin-tree 517-sendButton 518-dark-mode-labels-of-the-graph-should-be-white 520-design-logo-of-public-folder-is-not-shown 521-dev-webdriver-tests 529-graph-toolbar-add-tooltips-legends-on-buttons 530-tree-change-the-hide-tree-button-by-a-more-intuitive-toggle-button-display-the-btn-in-the-lateral-bar 536-dev-chart-component-fixes 540-search-show-api-tab 541-dev-doc-table-stars 544-dev-term-table-suggestion-fix-for-children 546-dev-ngrams-scroll-position 547-dev-ngrams-context-sidebar 548-dev-node-url-share 551-dev-annotation-fix 554-design-improve-the-position-of-the-icons 555-abstract-almost-disapear-in-graph-s-doc-view-when-there-is-too-much-authors 555-abstract-almost-disapear-in-graph-s-doc-view-when-there-is-too-much-authors-2 556-forest-tree-node-focus-find-a-way-to-focus-on-the-current-node-in-the-forest-layout-layout 560-dev-graph-add-count-of-docs 561-dev-add-document-wrong-date 562-doc-annotation-menu-selectoin 562-doc-annotation-the-selected-term-menu-selection-has-disappeared 563-dev-doc-ngrams-sync 563-dev-highlight-fixes 563-dev-highlight-fixes-tmp 565-dev-ngrams-table-click-on-child 566-node-terms-restore-a-good-display-the-main-table-cols-display-since-adding-the-show-column 567-graph-rearrange-the-graph-toolbar 568-node-content-breadcrumb-display-the-full-path-of-a-node-as-a-breadcrumb-with-each-clickable-parent 569-top-header-navbar-reorganize-to-navbar 569-top-header-navbar-reorganize-to-navbar-2 571-dev-node-search-api-fixes 571-dev-search-field-fixes 573-node-terms-popin-side-panel-styles-harmonization 576-phylo-refresh-in-phylo-params-add-a-class-active-on-buttons 577-node-docs-popin-dimensions-and-scroll-improvement 578-node-docs-on-the-refresh-dialog-set-both-as-default-and-on-documents-page-remove-2-unused-icons 579-dev-login-button-fix 580-dev-phylo-params 580-phylo-params-display-improvements 581-node-phylo-form-render-improvements 582-dev-phylo-default-behavior 587-node-options-flower-standardise-upload-and-download-buttons-order 593-dev-pubmed-api-key 594-dev-ngrams-click 594-dev-ngrams-patch-fixes 597-tobar-update-link-documentation 598-dev-fixes-to-karp-rabin-ngrams-highlight 598-dev-ngrams-patches-fixes 600-dev-share-error 600-dev-team-invite-fixes 601-slider-level-of-observation-in-phylomemies 602-corpus-from-pads-put-en-as-default-value-in-the-import-form-language-field 603-dev-istex-zip-file-upload 604-user-page-fix-the-error-message-when-the-page-loads 608-fix-breadcrumb-security-hide-items-links 609-breadcrumb-limit-the-elements-that-the-user-is-allowed-to-see-and-add-links 615-dev-highlight-fixes 616-breadcrumb-remove-unnecessary-informations 618-trim-deblank-missing-in-invitations-modal-box 619-documents-from-istex-import-authors-have-always-a-comma-prefix-even-if-there-is-only-one 622-dev-lang-fix 624-corpus-hal-remove-comment-the-hal-all-lang-choice 626-dev-external-assets 628-dev-lang-fix 629-in-document-view-show-institute-field-of-the-document 629-in-document-view-show-institute-field-of-the-document-squashed 634-node-documents-in-the-settings-popin-remove-the-upload-button 634-node-documents-in-the-settings-popin-remove-the-upload-button-2 638-tree-search-enrich-search-results-with-the-path-of-the-node 640-dev-close-modals-with-esc-keypress 641-dev-node-naming-fixes 642-dev-phylo-explorer-regression 643-export-the-phylo-in-json-and-dot-format 643-export-the-phylo-in-json-and-dot-format-2 644-tree-node-graph-update-remove-it-the-resync-picto-no-longer-launch-a-reload-it-should-open-the-dialog-box-on-the-graph-reload-form-confirmation 646-nodes-layout-minor-improvements-icons-in-tabs-titles 647-node-type-api-gql-accomodate-an-additional-field-in-the-node-see-https-gitlab-iscpif-fr-gargantext-haskell-gargantext-issues-336-to-be-able-to-display-the-ty-name-of-a-node 648-dev-graphql-breadcrumbs 655-dev-graph-explorer-search-spaces 668-phylo-on-the-exported-svg-file-fix-the-background-color-behind-the-label 669-tree-focus-temporary-hotfix-comment-the-forced-focus-forest-open-nodes-for-performances-reason 670-dev-first-tree-lighter-calls 671-dev-update-deps 673-dev-phylo-term-selection 674-dev-search-reload 676-csv-tsv-in-all-codebase 679-corpus-import-docs-from-selected-list-is-broken 683-dev-graph-explorer-legend 687-dev-document-star 689-dev-dynamic-legend 689-dev-graph-legend-improvements 689-dev-graph-legend-improvements-pt-2 691-node-terms-in-settings-on-the-download-tab-put-json-as-default-selectbox-choice-instead-of-the-current-json-zipped 694-dev-mobile-version 695-node-document-display-the-db-source-of-a-document-with-authors-etc 696-add-separators-between-keywords-in-phylo 698-dev-ws-host-fix 699-node-graph-display-the-graph-toolbar-by-default-il-would-make-it-possible-to-control-more-quickly-play-pause 701-dev-fix-nix-build 704-dev-fix-ws-update-for-a-pinned-tree 705-dev-upgrade-sigma-js 706-dev-display-node-count-in-toolbar 706-dev-graph-params-display 708-dev-sigma-settings 709-node-corpus-import-file-dialog-improvements 710-topbar-update-the-navigation-bar-links-in-the-info-dropdown 711-home-when-user-is-logged-display-an-easy-entry-to-create-a-corpus 712-dev-unify-css 717-dev-locate-in-tree 717-locate-in-tree 718-dev-subcorpus-frontend 719-dev-share-url-copy 726-tree-style-fixes 728-dev-csv-upload-error-message 729-corpus-upload-fix-an-error-on-form-select-nolist-option 730-frontend-for-bridgeness-method-choice 731-corpus-search-form-open-alex-filters-fix-conflicts 732-node-settings-documentation-tab-sould-be-active-by-default-while-opening-the-dialog-box 736-dev-fix-upload-sending-nothing-as-lang 77-dev-search-result-type-fix 80-dev-frontend-errors 90-dev-generic-zip-file 90-dev-wos-zip-parser adinapoli/garg-375 adinapoli/issue-364 adinapoli/issue-735 adinapoli/predictable-purescript-rev-path adinapoli/rename-unpublish adinapoli/support-emitting-warnings applypatchmap-perfs arturo-dev-230109-code-section-block-rc0.x arturo-dev-230109-sidebar-closing-rc0.x arturo-dev-230109-tree-select-indicator-rc0.x arturo-dev-node-term-rerendering-rc0.x arturo-dev-node-term-rerendering-rc1.x arturo-dev-node-terms-ux-rc0.x arturo-dev-node-terms-ux-rc1.x arturo-dev-react-tooltip-warning-rc0.x arturo/220414-CSS-move-nodes-rc0.x async-workers auto-reload block-based-editor build-with-nix cherry-pick-2e05fc87 cm-detect-file-type dev-269-DoorWelcome dev-301-visio-fix-suggestion dev-303-refactoring dev-503-progressBarWaitingText dev-508-clean-warnings-and-deprecated-code dev-509-improve-global-theme dev-511-tree-on-the-right dev-519-weird-behavior-of-waiting-bars dev-523-node-sharing-completions-css dev-552-home-instances-blocks-adding-logout-btn dev-593-pubmed-api-key dev-add-edge-weight-control dev-annotation-bootstrap-background dev-annuaire-file-upload dev-arxiv dev-async-file-upload dev-async-progress-fix dev-async-tasks-local-storage dev-auth dev-authors-search dev-backend-connection dev-backend-connection-np-wip dev-backend-connection-purty dev-backend-connection-sessions-instances dev-bdd dev-big-file-upload dev-bipartite dev-bootstrap-v4-upgrade dev-charts-update-economy dev-code dev-community dev-corpus-add-file dev-corpus-query-async dev-corpus-search-query-fix dev-css dev-dashboard-charts dev-david dev-doc dev-doc-annot-issue-213 dev-doc-annotation-issue dev-doc-annotation-new-term-no-spaces dev-doc-annotation-ui dev-doc-multi-annotation dev-doc-secu dev-doc-table-cache-issue dev-doc-table-columns dev-doc-table-optimization dev-doc-table-reactix-refactor dev-doc-table-score dev-docs-table-pagination-fix dev-docsTable dev-docstable-fixes dev-enter-confirmation dev-epo-integration dev-epo-patents dev-explorer-fixes dev-file-upload dev-fix-chart-flickering dev-fix-for-nolist-serialization dev-fix-input-with-text dev-fix-progress-bar dev-fix-update-node-params-list-serialization dev-folders-parent dev-force-atlas-memory-leak dev-forest dev-forest-open-close-memory dev-frame-calc-corpus-csv-upload dev-frame-fixes dev-gql-user-token dev-graph dev-graph-argh dev-graph-async-update dev-graph-eff-rewrite dev-graph-explorer-node-slider dev-graph-explorer-save-gexf dev-graph-explorer-search dev-graph-explorer-snapshot dev-graph-loader dev-graph-multipartite dev-graph-screenshot dev-graph-screenshot-fixes dev-graph-sidebar-styling-fixes dev-graphql dev-graphql-deriving dev-group-ngrams dev-hack-no-inf-rec dev-hackathon-fixes dev-hal-notebook dev-hash dev-highlight-currently-selected-node-in-tree dev-hot dev-iframe-test dev-iframe-tools dev-ihaskell dev-implement-temporary-file-storage-444 dev-indexation dev-info-button-refactor dev-input-text-autosave dev-istex dev-kawen dev-legacy-csv-list-upload dev-list-charts dev-list-get dev-list-upload dev-listmod-cache dev-localhost-ssl dev-log-topbar dev-markdown dev-menu-refactor dev-merge dev-merge-bootstrap dev-merge-bootstrap-downgrade dev-mpanelaction-fix dev-multi-term-selection dev-ngrams-pagination-fix dev-ngrams-pagination-fix-2 dev-ngrams-refactoring dev-ngrams-search-tentative-fix dev-ngrams-table dev-ngrams-table-cache-in-local-storage dev-ngrams-table-online dev-ngrams-table-search-page-flicker-fix dev-nix-bug dev-nix-upgrade dev-no-material-icons dev-noHisto dev-node-async dev-node-calc-parser dev-node-corpus-add-text-cells dev-node-folders-edition dev-openalex dev-padagraph-node dev-phylo dev-phylo-r5.x dev-phylo-rc1.x dev-phylo-rc2.x dev-phylo-rc3.x dev-phylo-rc4.x dev-prettyNodeType-form dev-ps-0.13.6 dev-ps-0.14.4 dev-public dev-purescript-0.14.3 dev-purty dev-reactix-upgrade dev-refact dev-refactor-views-panel dev-release dev-release-candidate-0.0.7.4.3 dev-remove-all-lang dev-renaming dev-right-panel-in-docs dev-root-refresh-fix dev-scroll-fix dev-search-removal dev-searx-iframe dev-searx-parser dev-select-all-buttons dev-seq-reverse-fix dev-sidebar-root-node-patch dev-sidebar-visibility-rc1.x dev-sidebar-visibility-rc2.x dev-sidebar-visibility-rc3.x dev-sidebar-visibility-rc4.x dev-sigmajs-selector dev-spago-next dev-spago-next-edge-weight dev-spago-next-with-flake dev-subtree dev-table-syncResetButton dev-tagcloud dev-term-list-fix dev-term-moving-fix dev-test dev-testing dev-textflow dev-theming dev-tree-handed dev-tree-node-name-length dev-tree-refresh dev-tree-refresh2 dev-tree-reload dev-tree-sort dev-upload-form-adjust-file-type-to-extension dev-upload-lang dev-upload-zip dev-use-sequence-instead-of-list-in-table dev-user-page dev-user-page-lens-test dev-version dev-warnings-cleanup dev-websockets dev-window enum-generic-encoding extras feature-flag-hook feature/docker feature/no-compose feature/prod-build feature/sessions-persistence feature/sigmax-graph-explorer feature/sigmax-graph-explorer-force-atlas feature/toestand-global-state fix-361 fix-left-margin-user fix-localstorage-hook fix-quote-with-space fix-spago-usage fix-tree-loading-stale-state fix-tree-somehow fix/386 flake-update generic-sum-argonaut haskell-190-dev-fixes-to-framecalc-post-request highlight-current-node iframe-interaction install-yarn-build issue181 issue184 junk/arturo/210726-react-memo lists-ngramstable master ngrams-replace ngrams-table-offline-changes nullary-constructors-json open-alex-filers psc-package-nix purescript-0.13.4 purescript-format puresript-format-ci reload-on-upload reload-tree-on-upload search-fixes stable store-tree-state testing testing-fix testing-fixes tree-update 0.0.7.4.7 0.0.7.4.6 0.0.7.4.5 0.0.7.4.4 0.0.7.4.3 0.0.7.4.2 0.0.7.4.1 0.0.7.4 0.0.7.3.8 0.0.7.3.7 0.0.7.3.6 0.0.7.3.5 0.0.7.3.4 0.0.7.3.3 0.0.7.3.2 0.0.7.3.1 0.0.7.3 0.0.7.2.8 0.0.7.2.7 0.0.7.2.6 0.0.7.2.5 0.0.7.2.4 0.0.7.2.3 0.0.7.2.2 0.0.7.2.1 0.0.7.2 0.0.7.1.16 0.0.7.1.15 0.0.7.1.14 0.0.7.1.13 0.0.7.1.12 0.0.7.1.11 0.0.7.1.10 0.0.7.1.9 0.0.7.1.8 0.0.7.1.7.4 0.0.7.1.7.3 0.0.7.1.7.2 0.0.7.1.7.1 0.0.7.1.7 0.0.7.1.6.5 0.0.7.1.6.4 0.0.7.1.6.3 0.0.7.1.6.2 0.0.7.1.6.1 0.0.7.1.6 0.0.7.1.5.5 0.0.7.1.5.4 0.0.7.1.5.3 0.0.7.1.5.2 0.0.7.1.5.1 0.0.7.1.5 0.0.7.1.4 0.0.7.1.3 0.0.7.1.2 0.0.7.1.1 0.0.7.1 0.0.7 0.0.6.9.9.9.9.1 0.0.6.9.9.9.9 0.0.6.9.9.9.8.1 0.0.6.9.9.9.8 0.0.6.9.9.9.7.3 0.0.6.9.9.9.7.2.1 0.0.6.9.9.9.7.2 0.0.6.9.9.9.7.1 0.0.6.9.9.9.7 0.0.6.9.9.9.6.7.1 0.0.6.9.9.9.6.7 0.0.6.9.9.9.6.6 0.0.6.9.9.9.6.5.1 0.0.6.9.9.9.6.5 0.0.6.9.9.9.6.4 0.0.6.9.9.9.6.3 0.0.6.9.9.9.6.2 0.0.6.9.9.9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.5 0.0.2.4 0.0.2.3 0.0.2.2.1 0.0.2.2 0.0.2.1 0.0.2.0 0.0.1.96.0 0.0.1.95.0 0.0.1.94.1 0.0.1.94.0 0.0.1.93.0 0.0.1.92.0 0.0.1.91.7 0.0.1.91.6 0.0.1.91.5 0.0.1.91.4 0.0.1.91.3 0.0.1.91.2 0.0.1.91.1 0.0.1.91.0 0.0.1.9.10 0.0.1.9.9 0.0.1.9.8 0.0.1.9.7 0.0.1.9.6 0.0.1.9.5 0.0.1.9.4 0.0.1.9.3 0.0.1.9.2 0.0.1.9.1 0.0.1.9 0.0.1.8.6 0.0.1.8.5 0.0.1.8.4 0.0.1.8.3 0.0.1.8.2 0.0.1.8.1 0.0.1.8 0.0.1.7.6 0.0.1.7.5 0.0.1.7.4 0.0.1.7.3 0.0.1.7.2 0.0.1.7.1 0.0.1.7 0.0.1.6.9 0.0.1.6.8 0.0.1.6.7 0.0.1.6.6 0.0.1.6.5 0.0.1.6.4 0.0.1.6.3 0.0.1.6.2 0.0.1.6.1 0.0.1.6 0.0.1.5.2 0.0.1.5.1 0.0.1.5 0.0.1.4.1 0.0.1.4 0.0.1.3.4 0.0.1.3.3 0.0.1.3.2 0.0.1.3.1 0.0.1.3 0.0.1.2 0.0.1.1 0.0.1.0 0.0.0.9 0.0.0.8 0.0.0.7 0.0.0.6 0.0.0.5 0.0.0.4
No related merge requests found
......@@ -28,7 +28,7 @@ import Reactix.SyntheticEvent as E
import Gargantext.Types ( TermList )
import Gargantext.Components.Annotation.Utils ( termBootstrapClass )
import Gargantext.Components.NgramsTable.Core ( NgramsTerm, NgramsTable(..), _NgramsElement, _list, highlightNgrams, nGramsRegex )
import Gargantext.Components.NgramsTable.Core ( NgramsTerm, NgramsTable(..), _NgramsElement, _list, highlightNgrams, findNgramTermList )
import Gargantext.Components.Annotation.Menu ( AnnotationMenu, annotationMenu, MenuType(..) )
import Gargantext.Utils.Selection as Sel
......@@ -80,10 +80,9 @@ maybeShowMenu setMenu setTermList ngrams event = do
sel' -> do
let x = E.clientX event
y = E.clientY event
sel'' = S.trim $ R.replace nGramsRegex " " sel'
list = findNgram ngrams sel''
list = findNgramTermList ngrams sel'
setList t = do
setTermList sel'' list t
setTermList sel' list t
setMenu (const Nothing)
E.preventDefault event
setMenu (const $ Just { x, y, list, menuType: NewNgram, setList })
......@@ -100,9 +99,6 @@ maybeAddMenu _ e _ = e
compile :: NgramsTable -> Maybe String -> Array (Tuple String (Maybe TermList))
compile ngrams = maybe [] (highlightNgrams ngrams)
findNgram :: NgramsTable -> String -> Maybe TermList
findNgram (NgramsTable m) s = m ^? at s <<< _Just <<< _NgramsElement <<< _list
-- Runs
type Run =
......
module Gargantext.Components.NgramsTable.Core
( PageParams
, CoreParams
, PatchMap
, NgramsElement(..)
, _NgramsElement
, NgramsPatch(..)
......@@ -11,12 +10,13 @@ module Gargantext.Components.NgramsTable.Core
, NgramsPatches
, _NgramsTable
, NgramsTerm
, normNgram
, findNgramTermList
, Version
, Versioned(..)
, VersionedNgramsTable
, CoreState
, LoadedNgramsTableProps
, nGramsRegex
, highlightNgrams
, initialPageParams
, loadNgramsTable
......@@ -211,11 +211,14 @@ instance decodeJsonNgramsTable :: DecodeJson NgramsTable where
f e@(NgramsElement e') = Tuple e'.ngrams e
-----------------------------------------------------------------------------------
nGramWordBoundaries = "[ .,;:!?'\\{}()]"
nGramsRegex = case R.regex ("(" <> nGramWordBoundaries <> ")") (R.global <> R.multiline) of
wordBoundaryChars :: String
wordBoundaryChars = "[ .,;:!?'\\{}()]"
wordBoundaryReg = case R.regex ("(" <> wordBoundaryChars <> ")") (R.global <> R.multiline) of
Left e -> unsafePartial $ crashWith e
Right r -> r
nGramsRegex2 = case R.regex ("(" <> nGramWordBoundaries <> ")\\1") (R.global <> R.multiline) of
wordBoundaryReg2 = case R.regex ("(" <> wordBoundaryChars <> ")\\1") (R.global <> R.multiline) of
Left e -> unsafePartial $ crashWith e
Right r -> r
......@@ -227,15 +230,15 @@ highlightNgrams (NgramsTable table) input0 =
let sN = unsafePartial (foldl goFold {i0: 0, s: input, l: Nil} ixs) in
A.reverse (A.fromFoldable (consNonEmpty (undb (init sN.s)) sN.l))
where
spR x = " " <> R.replace nGramsRegex "$1$1" x <> " "
reR = R.replace nGramsRegex " "
spR x = " " <> R.replace wordBoundaryReg "$1$1" x <> " "
reR = R.replace wordBoundaryReg " "
db = S.replace (S.Pattern " ") (S.Replacement " ")
sp x = " " <> db x <> " "
undb = R.replace nGramsRegex2 "$1"
undb = R.replace wordBoundaryReg2 "$1"
init x = S.take (S.length x - 1) x
input = spR input0
pats = A.fromFoldable (Map.keys table)
ixs = indicesOfAny (sp <$> pats) (S.toLower $ reR input)
ixs = indicesOfAny (sp <$> pats) (normNgram input)
consOnJustTail s xs@(Tuple _ (Just _) : _) =
Tuple s Nothing : xs
......@@ -483,8 +486,14 @@ type NgramsTablePatch =
fromNgramsPatches :: NgramsPatches -> NgramsTablePatch
fromNgramsPatches ngramsPatches = {ngramsNewElems: mempty, ngramsPatches}
normNgram :: String -> NgramsTerm
normNgram = S.toLower <<< R.replace wordBoundaryReg " "
findNgramTermList :: NgramsTable -> String -> Maybe TermList
findNgramTermList (NgramsTable m) s = m ^? at (normNgram s) <<< _Just <<< _NgramsElement <<< _list
singletonNgramsTablePatch :: NgramsTerm -> NgramsPatch -> NgramsTablePatch
singletonNgramsTablePatch n p = fromNgramsPatches $ singletonPatchMap (S.toLower n) p
singletonNgramsTablePatch n p = fromNgramsPatches $ singletonPatchMap (normNgram n) p
type RootParent = { root :: NgramsTerm, parent :: NgramsTerm }
......@@ -559,7 +568,7 @@ postNewElems newElems params = void $ traverseWithIndex postNewElem newElems
addNewNgram :: NgramsTerm -> TermList -> NgramsTablePatch
addNewNgram ngrams list = { ngramsPatches: mempty
, ngramsNewElems: Map.singleton (S.toLower ngrams) list }
, ngramsNewElems: Map.singleton (normNgram ngrams) list }
putNgramsPatches :: {nodeId :: Int, listIds :: Array Int, tabType :: TabType} -> Versioned NgramsPatches -> Aff (Versioned NgramsPatches)
putNgramsPatches {nodeId, listIds, tabType} =
......
......@@ -207,6 +207,7 @@ pathUrl c (Chart {chartType, tabType}) i =
------------------------------------------------------------
routesPath :: R.Routes -> String
routesPath R.Home = ""
routesPath R.Login = "login"
routesPath R.SearchView = "search"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment