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
d085a67c
Commit
d085a67c
authored
6 years ago
by
jsclose
Browse files
Options
Downloads
Patches
Plain Diff
completed solve
parent
9aef7820
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Website
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
constraintSolver/ISRContainer.cpp
+28
-5
28 additions, 5 deletions
constraintSolver/ISRContainer.cpp
constraintSolver/ISRContainer.h
+1
-0
1 addition, 0 deletions
constraintSolver/ISRContainer.h
with
29 additions
and
5 deletions
constraintSolver/ISRContainer.cpp
+
28
−
5
View file @
d085a67c
...
...
@@ -24,20 +24,25 @@ void ISRContainer::compile( )
ISR
*
ISRContainer
::
recurviseCompile
(
Tuple
*
root
)
{
vector
<
ISR
*
>
term
s
;
vector
<
ISR
*
>
word
s
;
if
(
root
->
Type
==
WordTupleType
)
return
new
ISRWord
(
root
->
object
.
text
);
{
string
currentTerm
;
terms
.
push_back
(
currentTerm
);
return
new
ISRWord
(
currentTerm
);
}
else
{
for
(
auto
child
:
root
->
Next
)
term
s
.
push_back
(
recurviseCompile
(
child
)
);
word
s
.
push_back
(
recurviseCompile
(
child
)
);
}
if
(
root
->
Type
==
AndTupleType
)
return
new
ISRAnd
(
term
s
);
return
new
ISRAnd
(
word
s
);
else
return
new
ISROr
(
term
s
);
return
new
ISROr
(
word
s
);
}
...
...
@@ -47,6 +52,8 @@ void ISRContainer::Solve( )
{
auto
url
=
Contained
->
GetEndDocument
()
->
getCurrentDoc
().
url
;
cout
<<
url
<<
endl
;
Location
BeginningfDocument
=
Contained
->
GetISRToBeginningOfDocument
(
);
PassToRanker
(
BeginningfDocument
);
Contained
->
NextDocument
(
);
...
...
@@ -72,3 +79,19 @@ void ISRContainer::Solve( )
}
void
ISRContainer
::
PassToRanker
(
Location
docBeginning
)
{
vector
<
ISRWord
*
>
toRanker
;
for
(
auto
term
:
Terms
)
{
ISRWord
*
isrWord
=
new
ISRWord
(
term
)
;
isrWord
->
Seek
(
docBeginning
);
toRanker
.
push_back
(
isrWord
);
}
ranker
.
rank
(
toRanker
)
}
This diff is collapsed.
Click to expand it.
constraintSolver/ISRContainer.h
+
1
−
0
View file @
d085a67c
...
...
@@ -56,6 +56,7 @@ public:
*
*/
void
Solve
(
);
void
PassToRanker
(
Location
BeginningfDocument
);
private
:
...
...
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