Skip to content

Commit

Permalink
Remove unordered map. It just adds extra includes.
Browse files Browse the repository at this point in the history
Also remove unistd.h include.
  • Loading branch information
skeskinen committed May 10, 2023
1 parent 9b1a20d commit cd2170d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions bert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@
#include <string>
#include <vector>
#include <iostream>
#include <unistd.h>
#include <regex>
#include <thread>
#include <algorithm>
#include <unordered_map>

// if using clang under macos, use unordered_map
#if defined(__APPLE__)
#include <unordered_map>
#endif

// default hparams (all-MiniLM-L6-v2)
struct bert_hparams
Expand Down Expand Up @@ -213,7 +206,7 @@ static size_t utf8_len(char src)
std::string stripAccents(const std::string &inputString)
{
std::string resultString;
std::unordered_map<std::string, char> accentMap = {{"À", 'A'},{"Á", 'A'},
std::map<std::string, char> accentMap = {{"À", 'A'},{"Á", 'A'},
{"Â", 'A'},{"Ã", 'A'},{"Ä", 'A'},{"Å", 'A'},{"à", 'a'},{"á", 'a'},
{"â", 'a'},{"ã", 'a'},{"ä", 'a'},{"å", 'a'},{"È", 'E'},{"É", 'E'},
{"Ê", 'E'},{"Ë", 'E'},{"è", 'e'},{"é", 'e'},{"ê", 'e'},{"ë", 'e'},
Expand Down

0 comments on commit cd2170d

Please sign in to comment.