1212
1313#include < iostream>
1414#include < string>
15- #include < vector>
1615#include < unordered_map>
16+ #include < vector>
1717
1818namespace py = pybind11;
1919
@@ -118,19 +118,19 @@ class ServicePyAdapter {
118118 return responses;
119119 }
120120
121- void setTerminology (py::dict terminology, bool forceTerminology= false ) {
121+ void setTerminology (py::dict terminology, bool forceTerminology = false ) {
122122 // It seems copying is not too bad for performance. Also this should happen rarely and with small objects
123123 // https://github.com/pybind/pybind11/issues/3033
124124 std::unordered_map<std::string, std::string> cppTerminology;
125125 for (std::pair<py::handle, py::handle> item : terminology) {
126- auto key = item.first .cast <std::string>();
127- auto value = item.second .cast <std::string>();
128- cppTerminology[key] = value;
126+ auto key = item.first .cast <std::string>();
127+ auto value = item.second .cast <std::string>();
128+ cppTerminology[key] = value;
129129 }
130130 service_.setTerminology (cppTerminology, forceTerminology);
131131 }
132132
133- private /* functions*/ :
133+ private /* functions*/ :
134134 static Service make_service (const Service::Config &config) {
135135 py::scoped_ostream_redirect outstream (std::cout, // std::ostream&
136136 py::module_::import (" sys" ).attr (" stdout" ) // Python output
@@ -144,7 +144,7 @@ class ServicePyAdapter {
144144 return Service (config);
145145 }
146146
147- private /* data*/ :
147+ private /* data*/ :
148148 Service service_;
149149};
150150
@@ -213,8 +213,8 @@ PYBIND11_MODULE(_bergamot, m) {
213213 .def (" setTerminology" , &ServicePyAdapter::setTerminology);
214214
215215 py::class_<Service::Config>(m, " ServiceConfig" )
216- .def (py::init<>([](size_t numWorkers, size_t cacheSize, std::string logging,
217- std::string pathToTerminologyFile, bool terminologyForce, std::string terminologyForm ) {
216+ .def (py::init<>([](size_t numWorkers, size_t cacheSize, std::string logging, std::string pathToTerminologyFile,
217+ bool terminologyForce, std::string terminologyForm) {
218218 Service::Config config;
219219 config.numWorkers = numWorkers;
220220 config.cacheSize = cacheSize;
0 commit comments