Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eecs398-search
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vcday
eecs398-search
Commits
f2efce2b
Commit
f2efce2b
authored
6 years ago
by
Nicholas Yang
Browse files
Options
Downloads
Patches
Plain Diff
testing with moment and life
parent
f479081f
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Website
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Corpus-tests
+0
-0
0 additions, 0 deletions
Corpus-tests
indexer/Corpus.h
+0
-3
0 additions, 3 deletions
indexer/Corpus.h
indexer/WordInfo.h
+4
-5
4 additions, 5 deletions
indexer/WordInfo.h
indexer/tests/CorpusTests.cpp
+22
-0
22 additions, 0 deletions
indexer/tests/CorpusTests.cpp
with
26 additions
and
8 deletions
Corpus-tests
+
0
−
0
View file @
f2efce2b
No preview for this file type
This diff is collapsed.
Click to expand it.
indexer/Corpus.h
+
0
−
3
View file @
f2efce2b
...
...
@@ -16,9 +16,6 @@ public:
size_t
numberDocuments
;
size_t
numberWords
;
std
::
vector
<
Chunk
>
chunks
;
private:
MMDiskHashTable
master
=
MMDiskHashTable
(
util
::
GetCurrentWorkingDir
()
+
IndexerConstants
::
pathToIndex
+
"master.txt"
,
...
...
This diff is collapsed.
Click to expand it.
indexer/WordInfo.h
+
4
−
5
View file @
f2efce2b
...
...
@@ -6,11 +6,6 @@ class WordInfo {
public:
/**
* Meant to parse in input from master DHT
* @param value Value from DHT
*/
WordInfo
()
{
chunks
=
std
::
vector
<
int
>
();
frequency
=
0
;
...
...
@@ -18,6 +13,10 @@ public:
lastLocation
=
0
;
}
/**
* Meant to parse in input from master DHT
* @param value Value from DHT
*/
WordInfo
(
string
value
)
{
if
(
value
==
""
)
{
return
;
...
...
This diff is collapsed.
Click to expand it.
indexer/tests/CorpusTests.cpp
+
22
−
0
View file @
f2efce2b
...
...
@@ -15,5 +15,27 @@ int main() {
cout
<<
"
\t
Number documents: "
<<
corpus
.
chunks
[
i
].
numberDocs
<<
endl
;
cout
<<
"
\t
Ending offset: "
<<
corpus
.
chunks
[
i
].
lastLocation
<<
endl
;
}
WordInfo
momentInfo
=
corpus
.
getWordInfo
(
"moment"
);
cout
<<
"Moment"
<<
endl
;
cout
<<
"
\t
Chunks: "
;
for
(
auto
chunk
:
momentInfo
.
chunks
)
{
cout
<<
chunk
<<
" "
;
}
cout
<<
endl
;
cout
<<
"
\t
Document frequency: "
<<
momentInfo
.
docFrequency
<<
endl
;
cout
<<
"
\t
Frequency: "
<<
momentInfo
.
frequency
<<
endl
;
cout
<<
"
\t
Last location: "
<<
momentInfo
.
lastLocation
<<
endl
;
WordInfo
lifeInfo
=
corpus
.
getWordInfo
(
"life"
);
cout
<<
"Life"
<<
endl
;
cout
<<
"
\t
Chunks: "
;
for
(
auto
chunk
:
lifeInfo
.
chunks
)
{
cout
<<
chunk
<<
" "
;
}
cout
<<
endl
;
cout
<<
"
\t
Document frequency: "
<<
lifeInfo
.
docFrequency
<<
endl
;
cout
<<
"
\t
Frequency: "
<<
lifeInfo
.
frequency
<<
endl
;
cout
<<
"
\t
Last location: "
<<
lifeInfo
.
lastLocation
<<
endl
;
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment