Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
f0a7e136
Commit
f0a7e136
authored
May 09, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Annotation] case insensitive.
parent
52cafafa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
NgramsTable.purs
src/Gargantext/Components/NgramsTable.purs
+8
-2
BreakWords.purs
src/Gargantext/Text/BreakWords.purs
+1
-1
No files found.
src/Gargantext/Components/NgramsTable.purs
View file @
f0a7e136
...
@@ -31,7 +31,7 @@ import Data.Array (head)
...
@@ -31,7 +31,7 @@ import Data.Array (head)
import Data.Array as A
import Data.Array as A
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson
, jsonEmptyObject, (:=), (~>), (.?), (.??) )
, jsonEmptyObject, (:=), (~>), (.?), (.??) )
import Data.Either (Either(..))
import Data.Either (Either(..)
, either
)
import Data.Foldable (class Foldable, foldMap, foldl, foldr)
import Data.Foldable (class Foldable, foldMap, foldl, foldr)
import Data.FoldableWithIndex (class FoldableWithIndex, foldMapWithIndex, foldlWithIndex, foldrWithIndex)
import Data.FoldableWithIndex (class FoldableWithIndex, foldMapWithIndex, foldlWithIndex, foldrWithIndex)
import Data.FunctorWithIndex (class FunctorWithIndex, mapWithIndex)
import Data.FunctorWithIndex (class FunctorWithIndex, mapWithIndex)
...
@@ -54,6 +54,8 @@ import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex)
...
@@ -54,6 +54,8 @@ import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex)
import Data.Set (Set)
import Data.Set (Set)
import Data.Set as Set
import Data.Set as Set
import Data.String as S
import Data.String as S
import Data.String.Regex as R
import Data.String.Regex.Flags as R
import Data.Symbol (SProxy(..))
import Data.Symbol (SProxy(..))
import Data.Tuple (Tuple(..))
import Data.Tuple (Tuple(..))
import Effect (Effect)
import Effect (Effect)
...
@@ -207,7 +209,11 @@ highlightNgrams (NgramsTable table) input0 =
...
@@ -207,7 +209,11 @@ highlightNgrams (NgramsTable table) input0 =
Just x1 -> S.replaceAll (S.Pattern " ") (S.Replacement " ") (S.drop 1 x1)
Just x1 -> S.replaceAll (S.Pattern " ") (S.Replacement " ") (S.drop 1 x1)
input = sp input0
input = sp input0
pats = A.fromFoldable (Map.keys table)
pats = A.fromFoldable (Map.keys table)
ixs = indicesOfAny (sp <$> pats) input
ixs = indicesOfAny (sp <$> pats) (S.toLower $ R.replace theRegex " " input)
where
theRegex = case R.regex "[.,;:!?'\\{}()]" (R.global <> R.multiline) of
Left e -> unsafePartial $ crashWith e
Right r -> r
consNonEmpty x xs
consNonEmpty x xs
| S.null x = xs
| S.null x = xs
...
...
src/Gargantext/Text/BreakWords.purs
View file @
f0a7e136
...
@@ -43,7 +43,7 @@ next b origin word =
...
@@ -43,7 +43,7 @@ next b origin word =
do traverse_ (pushSpace b) $ preceding b origin word
do traverse_ (pushSpace b) $ preceding b origin word
pushWord b word
pushWord b word
pure true
pure true
preceding :: Breaking -> Int -> String -> Maybe String
preceding :: Breaking -> Int -> String -> Maybe String
preceding b origin word = p $ (lastIndex b) - (length word)
preceding b origin word = p $ (lastIndex b) - (length word)
where p o
where p o
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment