Skip to content

Commit

Permalink
fix clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
duj12 committed Sep 8, 2023
1 parent 019499f commit c7fa8d4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
1 change: 1 addition & 0 deletions runtime/core/api/wenet_api.cc
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.
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/post_processor/post_processor.cc
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.
Expand Down
1 change: 1 addition & 0 deletions runtime/core/post_processor/processor.cc
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.
Expand Down
4 changes: 3 additions & 1 deletion runtime/core/post_processor/processor.h
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.
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion runtime/core/post_processor/token_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "utils/string.h"

namespace wenet {
const std::string EOS = "<EOS>";
const char EOS[] = "<EOS>";
const std::set<std::string> UTF8_WHITESPACE = {" ", "\t", "\n", "\r",
"\x0b\x0c"};
const std::set<std::string> ASCII_LETTERS = {
Expand Down
13 changes: 3 additions & 10 deletions runtime/core/post_processor/token_parser.h
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.
Expand All @@ -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);
Expand Down Expand Up @@ -66,7 +59,7 @@ enum ParseType {

class TokenParser {
public:
TokenParser(ParseType type);
explicit TokenParser(ParseType type);
std::string reorder(const std::string& input);

private:
Expand Down

0 comments on commit c7fa8d4

Please sign in to comment.