Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2018-08-03 08:36:46 +0300
committerTaku Kudo <taku@google.com>2018-08-03 08:36:46 +0300
commit1caa5fb76eb41c7ce8bf17a67a1db7024d82e788 (patch)
tree9cd94115261e3927391561957315d194679be887 /src/bpe_model_trainer_test.cc
parenta0b734a4a2a2259e346f5b602ba807c5deef2f0b (diff)
Added JoinPath and StrCat
Diffstat (limited to 'src/bpe_model_trainer_test.cc')
-rw-r--r--src/bpe_model_trainer_test.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/bpe_model_trainer_test.cc b/src/bpe_model_trainer_test.cc
index 2061952..7a9c17d 100644
--- a/src/bpe_model_trainer_test.cc
+++ b/src/bpe_model_trainer_test.cc
@@ -89,15 +89,13 @@ TEST(BPETrainerTest, BasicTest) {
TEST(BPETrainerTest, EndToEndTest) {
const test::ScopedTempFile sf("tmp_model");
+ const std::string input =
+ util::JoinPath(FLAGS_data_dir, "wagahaiwa_nekodearu.txt");
- EXPECT_OK(SentencePieceTrainer::Train(std::string("--model_prefix=") +
- sf.filename() +
- " --input=" + FLAGS_data_dir +
- "/wagahaiwa_nekodearu.txt"
- " --vocab_size=8000"
- " --normalization_rule_name=identity"
- " --model_type=bpe"
- " --control_symbols=<ctrl>"));
+ EXPECT_OK(SentencePieceTrainer::Train(string_util::StrCat(
+ "--model_prefix=", sf.filename(), " --input=", input,
+ " --vocab_size=8000 --normalization_rule_name=identity"
+ " --model_type=bpe --control_symbols=<ctrl>")));
SentencePieceProcessor sp;
EXPECT_OK(sp.Load(std::string(sf.filename()) + ".model"));
@@ -117,10 +115,10 @@ TEST(BPETrainerTest, EndToEndTest) {
u8"。",
&tok));
EXPECT_EQ(WS
- " 吾輩 《 わが はい 》 は猫 である 。 名前 はまだ 無い 。 "
- "どこで 生 れた か とん と見 当 《 けんとう 》 が つかぬ 。 "
- "何でも 薄 暗 いじ め じ め した 所で ニャー ニャー 泣 いていた "
- "事 だけは 記憶 している 。",
+ u8" 吾輩 《 わが はい 》 は猫 である 。 名前 はまだ 無い 。 "
+ u8"どこで 生 れた か とん と見 当 《 けんとう 》 が つかぬ 。 "
+ u8"何でも 薄 暗 いじ め じ め した 所で ニャー ニャー 泣 いていた "
+ u8"事 だけは 記憶 している 。",
string_util::Join(tok, " "));
}