-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Copyright (c) 2022 Binbin Zhang ([email protected]) | ||
// 2023 Jing Du ([email protected]) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Copyright (c) 2021 Xingchen Song [email protected] | ||
// 2023 Jing Du [email protected] | ||
// 2023 Jing Du ([email protected]) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Copyright (c) 2022 Zhendong Peng ([email protected]) | ||
// 2023 Jing Du ([email protected]) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Copyright (c) 2022 Zhendong Peng ([email protected]) | ||
// 2023 Jing Du ([email protected]) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -15,8 +16,9 @@ | |
#ifndef POST_PROCESSOR_PROCESSOR_H_ | ||
#define POST_PROCESSOR_PROCESSOR_H_ | ||
|
||
#include <string> | ||
#include <memory> | ||
#include "fst/fstlib.h" | ||
|
||
#include "post_processor/token_parser.h" | ||
|
||
using fst::StdArc; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Copyright (c) 2022 Zhendong Peng ([email protected]) | ||
// 2023 Jing Du ([email protected]) | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -22,20 +23,12 @@ | |
|
||
namespace wenet { | ||
|
||
extern const std::string EOS; | ||
extern const std::set<std::string> UTF8_WHITESPACE; | ||
extern const std::set<std::string> ASCII_LETTERS; | ||
extern const std::unordered_map<std::string, std::vector<std::string>> | ||
TN_ORDERS; | ||
extern const std::unordered_map<std::string, std::vector<std::string>> | ||
ITN_ORDERS; | ||
|
||
struct Token { | ||
std::string name; | ||
std::vector<std::string> order; | ||
std::unordered_map<std::string, std::string> members; | ||
|
||
Token(const std::string& name) : name(name) {} | ||
explicit Token(const std::string& name) : name(name) {} | ||
|
||
void append(const std::string& key, const std::string& value) { | ||
order.emplace_back(key); | ||
|
@@ -66,7 +59,7 @@ enum ParseType { | |
|
||
class TokenParser { | ||
public: | ||
TokenParser(ParseType type); | ||
explicit TokenParser(ParseType type); | ||
std::string reorder(const std::string& input); | ||
|
||
private: | ||
|