Skip to content

Instantly share code, notes, and snippets.

@gwtnb
Created September 13, 2013 05:17
Show Gist options
  • Save gwtnb/6546990 to your computer and use it in GitHub Desktop.
Save gwtnb/6546990 to your computer and use it in GitHub Desktop.
diff --git a/mecab/src/tokenizer.cpp b/mecab/src/tokenizer.cpp
index ae5a9ba..9665bea 100644
--- a/mecab/src/tokenizer.cpp
+++ b/mecab/src/tokenizer.cpp
@@ -37,39 +37,6 @@ void inline read_node_info(const Dictionary &dic,
}
} // namespace
-template class Tokenizer<Node, Path>;
-template class Tokenizer<LearnerNode, LearnerPath>;
-template Tokenizer<Node, Path>::Tokenizer();
-template void Tokenizer<Node, Path>::close();
-template const DictionaryInfo
-*Tokenizer<Node, Path>::dictionary_info() const;
-template Node* Tokenizer<Node, Path>::getBOSNode(Allocator<Node, Path> *) const;
-template Node* Tokenizer<Node, Path>::getEOSNode(Allocator<Node, Path> *) const;
-template Node* Tokenizer<Node, Path>::lookup<false>(
- const char *,
- const char *,
- Allocator<Node, Path> *,
- Lattice *) const;
-template Node* Tokenizer<Node, Path>::lookup<true>(
- const char *,
- const char *,
- Allocator<Node, Path> *,
- Lattice *) const;
-template bool Tokenizer<Node, Path>::open(const Param &);
-template Tokenizer<LearnerNode, LearnerPath>::Tokenizer();
-template void Tokenizer<LearnerNode, LearnerPath>::close();
-template const DictionaryInfo
-*Tokenizer<LearnerNode, LearnerPath>::dictionary_info() const;
-template LearnerNode * Tokenizer<LearnerNode, LearnerPath>::getEOSNode(
- Allocator<LearnerNode, LearnerPath> *) const;
-template LearnerNode * Tokenizer<LearnerNode, LearnerPath>::getBOSNode(
- Allocator<LearnerNode, LearnerPath> *) const;
-template LearnerNode *Tokenizer<LearnerNode, LearnerPath>::lookup<false>(
- const char *,
- const char *,
- Allocator<LearnerNode, LearnerPath> *, Lattice *) const;
-template bool Tokenizer<LearnerNode, LearnerPath>::open(const Param &);
-
template <typename N, typename P>
Tokenizer<N, P>::Tokenizer()
: dictionary_info_freelist_(4),
@@ -390,4 +357,22 @@ void Tokenizer<N, P>::close() {
unk_tokens_.clear();
property_.close();
}
+
+template class Tokenizer<Node, Path>;
+template class Tokenizer<LearnerNode, LearnerPath>;
+template Node* Tokenizer<Node, Path>::lookup<false>(
+ const char *,
+ const char *,
+ Allocator<Node, Path> *,
+ Lattice *) const;
+template Node* Tokenizer<Node, Path>::lookup<true>(
+ const char *,
+ const char *,
+ Allocator<Node, Path> *,
+ Lattice *) const;
+template LearnerNode *Tokenizer<LearnerNode, LearnerPath>::lookup<false>(
+ const char *,
+ const char *,
+ Allocator<LearnerNode, LearnerPath> *, Lattice *) const;
+
}
@gwtnb
Copy link
Author

gwtnb commented Sep 13, 2013

Modified to compile with Intel C++ compiler and to conform C++ spec.

Removed duplicate explicit instantiations.
Moved explicit instantiations under class member definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment