コード例 #1
0
ファイル: sample.c プロジェクト: Bollegala/vowpal_wabbit
int main()
{
    VW_HANDLE vw;
    VW_EXAMPLE example;
    float score;

    printf("this is a native c program calling vw\n");
    vw = VW_InitializeA("-q st --noconstant --quiet");
    example = VW_ReadExampleA(vw, "1 |s p^the_man w^the w^man |t p^un_homme w^un w^homme");
    score = VW_Learn(vw, example);
    VW_Finish(vw);
    printf("Score = %f\n", score);
    return 0;

}
コード例 #2
0
ファイル: vwdll.cpp プロジェクト: Khoi--Nguyen/vowpal_wabbit
	VW_DLL_MEMBER VW_EXAMPLE VW_CALLING_CONV VW_ReadExample(VW_HANDLE handle, const char16_t * line)
	{
		std::wstring_convert<std::codecvt_utf8<char16_t>, char16_t> convert;
		std::string sa(convert.to_bytes(line));
		return VW_ReadExampleA(handle, sa.c_str());
	}