summaryrefslogtreecommitdiff
path: root/extractor/phrase_location.cc
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-02-14 23:17:15 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-02-14 23:17:15 +0000
commit63b30ed9c8510da8c8e2f6a456576424fddacc0e (patch)
tree1b5278fb5a4480b7f7a965bb6de8f6f9e9c4d333 /extractor/phrase_location.cc
parent0a53f7eca74c165b5ce1c238f1999ddf1febea55 (diff)
Working version of the grammar extractor.
Diffstat (limited to 'extractor/phrase_location.cc')
-rw-r--r--extractor/phrase_location.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/extractor/phrase_location.cc b/extractor/phrase_location.cc
index 984407c5..62f1e714 100644
--- a/extractor/phrase_location.cc
+++ b/extractor/phrase_location.cc
@@ -10,7 +10,11 @@ PhraseLocation::PhraseLocation(const vector<int>& matchings,
num_subpatterns(num_subpatterns) {}
bool PhraseLocation::IsEmpty() {
- return sa_low >= sa_high || (num_subpatterns > 0 && matchings->size() == 0);
+ if (num_subpatterns > 0) {
+ return matchings->size() == 0;
+ } else {
+ return sa_low >= sa_high;
+ }
}
bool operator==(const PhraseLocation& a, const PhraseLocation& b) {