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
4e207779
Commit
4e207779
authored
Feb 09, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[test] fix test-ps
parent
f910cd90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
27 deletions
+44
-27
README.md
README.md
+8
-0
shell.nix
shell.nix
+2
-1
Spec.purs
test/Gargantext/Components/NgramsTable/Spec.purs
+34
-26
No files found.
README.md
View file @
4e207779
...
...
@@ -192,6 +192,14 @@ yarn css # for manual setup
A guide to getting set up with the IDE integration is coming soon, I hope.
### Testing
To run unit tests, just run:
```
shell
test-ps
```
### Note to contributors
Please follow CONTRIBUTING.md
...
...
shell.nix
View file @
4e207779
...
...
@@ -35,7 +35,8 @@ let
build-purs
echo "Testing"
# yarn pulp browserify --skip-compile -t dist/bundle.js --src-path output
yarn pulp test --src-path output --test-path output
# yarn pulp test --src-path output --test-path output
NODE_PATH=output node -e "require('Test.Main').main();"
''
;
in
pkgs
.
mkShell
{
...
...
test/Gargantext/Components/NgramsTable/Spec.purs
View file @
4e207779
...
...
@@ -55,13 +55,12 @@ spec = do
]
, ngrams_scores: Map.fromFoldable [] }
input = "this is a graph about a biography which stops at every candidate"
output = [Tuple "this is a " Nothing
,Tuple " about a biography " Nothing
,Tuple "which" (Just StopTerm)
,Tuple " " Nothing
,Tuple "stops" (Just StopTerm)
,Tuple " at every " Nothing
,Tuple "candidate" (Just CandidateTerm)
output = [ Tuple "this is a graph about a biography " Nothing
, Tuple "which" (Just StopTerm)
, Tuple " " Nothing
, Tuple "stops" (Just StopTerm)
, Tuple " at every " Nothing
, Tuple "candidate" (Just CandidateTerm)
]
highlightNgrams CTabTerms table input `shouldEqual` output
...
...
@@ -74,18 +73,13 @@ spec = do
]
, ngrams_scores: Map.fromFoldable [] }
input = "This is a new state of the"
output = [Tuple "This " Nothing
,Tuple "is" (Just StopTerm)
,Tuple " " Nothing
,Tuple "a" (Just StopTerm)
,Tuple " " Nothing
,Tuple "new" Nothing
,Tuple " " Nothing
,Tuple "state" Nothing
,Tuple " " Nothing
,Tuple "of" (Just StopTerm)
,Tuple " " Nothing
,Tuple "the" Nothing
output = [ Tuple "This " Nothing
, Tuple "is" (Just StopTerm)
, Tuple " " Nothing
, Tuple "a" (Just StopTerm)
, Tuple " new state " Nothing
, Tuple "of" (Just StopTerm)
, Tuple " the" Nothing
]
highlightNgrams CTabTerms table input `shouldEqual` output
...
...
@@ -98,10 +92,24 @@ spec = do
]
, ngrams_scores: Map.fromFoldable [] }
input = "This is from space images"
output = [Tuple "This is " Nothing
,Tuple "from" (Just CandidateTerm)
,Tuple " space " Nothing
,Tuple "images" (Just CandidateTerm)
output = [ Tuple "This is " Nothing
, Tuple "from" (Just CandidateTerm)
, Tuple " space " Nothing
, Tuple "images" (Just CandidateTerm)
]
highlightNgrams CTabTerms table input `shouldEqual` output
it "works when pattern overlaps 3" do
let ngramType = CTabSources
let table = NgramsTable
{ ngrams_repo_elements: Map.fromFoldable [ tnre "fusion" MapTerm ngramType
, tnre "calculate fusion" CandidateTerm ngramType
]
, ngrams_scores: Map.fromFoldable [] }
input = "Model has been used to calculate fusion cross sections"
output = [ Tuple "Model has been used to " Nothing
, Tuple "calculate fusion" (Just CandidateTerm)
, Tuple " sections " Nothing
]
highlightNgrams CTabTerms table input `shouldEqual` output
...
...
@@ -111,8 +119,8 @@ spec = do
{ ngrams_repo_elements: Map.fromFoldable [ tnre "graph" CandidateTerm ngramType ]
, ngrams_scores: Map.fromFoldable [] }
input = "before graph, after"
output = [Tuple "before " Nothing
,Tuple "graph" (Just CandidateTerm)
,Tuple ", after" Nothing
output = [
Tuple "before " Nothing
,
Tuple "graph" (Just CandidateTerm)
,
Tuple ", after" Nothing
]
highlightNgrams CTabTerms table input `shouldEqual` output
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