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
acf23581
Commit
acf23581
authored
6 years ago
by
jsclose
Browse files
Options
Downloads
Patches
Plain Diff
pseudo code for container class
parent
0846e2b1
No related branches found
Branches containing commit
No related tags found
1 merge request
!8
Origin/constraint solver
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
constraintSolver/ISRContainer.h
+45
-17
45 additions, 17 deletions
constraintSolver/ISRContainer.h
with
45 additions
and
17 deletions
constraintSolver/ISRContainer.h
+
45
−
17
View file @
acf23581
...
...
@@ -6,49 +6,77 @@
#include
"ISR.h"
#include
"ISREndDoc.h"
#include
"../query/Ranker/Ranker.h"
//Find occurrences of contained ISRs in a single document not containing any excluded ISRs.
class
ISRContainer
:
ISR
class
ISRContainer
{
public:
ISR
**
Contained
,
*
Excluded
;
ISREndDoc
*
EndDoc
;
ISR
*
Contained
;
ISR
*
Excluded
;
vector
<
string
>
terms
;
unsigned
CountContained
,
CountExcluded
;
Location
Next
(
);
Post
*
Seek
(
Location
target
)
Location
Seek
(
Location
target
)
{
// 1. Seek all the included ISRs to the first occurrence beginning at
//
the target location.
//
the target location.
// 2. Move the document end ISR to just past the furthest
//
contained ISR, then calculate the document begin location.
//
contained ISR, then calculate the document begin location.
// 3. Seek all the other contained terms to past the document begin.
// 4. If any contained erm is past the document end, return to
//
step 2.
//
step 2.
// 5. If any ISR reaches the end, there is no match.
// 6. Seek all the excluded ISRs to the first occurrence beginning at
//
the document begin location.
//
the document begin location.
// 7. If any excluded ISR falls within the document, reset the
// target to one past the end of the document and return to
// step 1.
// target to one past the end of the document and return to
// step 1.
};
Post
*
Next
(
)
/*
* Seek()
* GetEndDocument
*
*/
void
Solve
()
{
Seek
(
Contained
[
nearestContained
]
->
GetStartlocation
(
)
+
1
);
while
(
Contained
->
GetCurrentLocation
()
!=
MAX_Location
)
{
/*
* beg = GetBeginning of Doc
* Pass Terms to ranker
*
* vector<words>
*
* Ranker:
* for term in terms
* IsrWord word = new ISR(term)
* Term.seek(beg)
* words.push(word)
* rank(words)
*
* NextDocument()
*/
}
}
private
:
unsigned
nearestTerm
,
farthestTerm
;
Location
nearestStartLocation
,
nearestEndLocation
;
Ranker
ranker
;
};
};
};
\ No newline at end of file
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