diff options
Diffstat (limited to 'scripts/training/phrase-extract/HoleCollection.cpp')
-rw-r--r-- | scripts/training/phrase-extract/HoleCollection.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/training/phrase-extract/HoleCollection.cpp b/scripts/training/phrase-extract/HoleCollection.cpp new file mode 100644 index 000000000..e675eceb0 --- /dev/null +++ b/scripts/training/phrase-extract/HoleCollection.cpp @@ -0,0 +1,28 @@ +/* + * HoleCollection.cpp + * extract + * + * Created by Hieu Hoang on 19/01/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ +#include <algorithm> +#include "HoleCollection.h" + +using namespace std; + +void HoleCollection::SortSourceHoles() +{ + assert(m_sortedSourceHoles.size() == 0); + + // add + HoleList::iterator iter; + for (iter = m_holes.begin(); iter != m_holes.end(); ++iter) + { + Hole &currHole = *iter; + m_sortedSourceHoles.push_back(&currHole); + } + + // sort + std::sort(m_sortedSourceHoles.begin(), m_sortedSourceHoles.end(), HoleSourceOrderer()); +} |