You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is not an "issue" related to Tongrams, rather to C++ programming.
In fact, I do not understand your code.
I see that you want a class that has a template parameter to specify the n-gram model type.
So it should look like this:
template <typename Model>
struct A {
/* all your public methods */
private:
Model model;
};
and then, in the main, you should specify the type of the model using one among those in the header file lm_types.hpp.
For example:
Hi @jermp
I want to add n-gram model to a class, but I don't know how to call the class from the main function.
I defined class A which contain n-gram model
template
class A
{
private:
Model* model;
public:
A(string model_path = ""){
model = new Model;
tongrams::util::load(*(model), model_path);
}
void fool(){
auto state = model->state();
}
};
but in main(), I don't know how to call class A, since I need a specific type for the model.
Do you know how to solve this?
Thank you in advance.
The text was updated successfully, but these errors were encountered: