Skip to content

Commit

Permalink
feat(all): format all files
Browse files Browse the repository at this point in the history
  • Loading branch information
xingchensong committed Dec 7, 2023
1 parent 93b78f4 commit d16bc8f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions runtime/processor/wetext_processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
#ifndef PROCESSOR_WETEXT_PROCESSOR_H_
#define PROCESSOR_WETEXT_PROCESSOR_H_

#include <memory>
#include <string>

#include "fst/fstlib.h"

#include "processor/wetext_token_parser.h"
Expand Down
2 changes: 1 addition & 1 deletion runtime/processor/wetext_token_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "utils/wetext_string.h"

namespace wetext {
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
6 changes: 3 additions & 3 deletions runtime/processor/wetext_token_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace wetext {

extern const std::string EOS;
extern const char 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>>
Expand All @@ -35,7 +35,7 @@ struct Token {
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 +66,7 @@ enum ParseType {

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

private:
Expand Down
2 changes: 1 addition & 1 deletion runtime/test/processor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ProcessorTest
processor = new wetext::Processor(tagger_path, verbalizer_path);
written = GetParam().first;
spoken = GetParam().second;
};
}

virtual void TearDown() { delete processor; }
};
Expand Down
2 changes: 1 addition & 1 deletion tn/chinese/rules/sport.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from tn.chinese.rules.cardinal import Cardinal
from tn.processor import Processor

from pynini import cross, string_file
from pynini import string_file
from pynini.lib.pynutil import delete, insert


Expand Down

0 comments on commit d16bc8f

Please sign in to comment.