中科院ICTCLAS的调用示例
2007-11-30 15:20
337 查看
// ICTCLAS_DOS.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "ICTCLAS.h"
#include <string.h>
int main(int argc, char* argv[])
{
//Sample1: Sentence or paragraph lexical analysis with only one result
char sSentence[2000],sSentenceResult[5000];
ICTCLAS_Init();
printf("Input sentence now!/n");
scanf("%s",sSentence);
while(_stricmp(sSentence,"q")!=0)
{
ICTCLAS_ParagraphProcess(sSentence,sSentenceResult);
printf("%s/nInput string now!/n",sSentenceResult);
scanf("%s",sSentence);
}
ICTCLAS_Exit();
//Sample2: File segmentation and POS tagging
/*
ICTCLAS_Init();
ICTCLAS_FileProcess("E://Sample//Corpus_NewPOS//199802_Org.txt","E://Sample//Corpus_NewPOS//199802_Org_cla.txt");
ICTCLAS_Exit();
*/
//Sample3: Sentence segmentation and POS tagging with multiple result
/*
char sSentence[2000],**sSentenceResult;
int i;
sSentenceResult=new char*[5];
for(i=0;i<5;i++)
sSentenceResult[i]=new char[5000];
ICTCLAS_Init();
printf("Input sentence now!/n");
scanf("%s",sSentence);
while(_stricmp(sSentence,"q")!=0)
{
ICTCLAS_SentenceProcess(sSentence,5,sSentenceResult);
for(i=0;i<5;i++)
printf("Result%d:%s/n",i+1,sSentenceResult[i]);
printf("Input string now!/n");
scanf("%s",sSentence);
}
ICTCLAS_Exit();
for(i=0;i<5;i++)
delete[] sSentenceResult[i];
delete [] sSentenceResult;
*/
return 0;
}
//
#include "stdafx.h"
#include "ICTCLAS.h"
#include <string.h>
int main(int argc, char* argv[])
{
//Sample1: Sentence or paragraph lexical analysis with only one result
char sSentence[2000],sSentenceResult[5000];
ICTCLAS_Init();
printf("Input sentence now!/n");
scanf("%s",sSentence);
while(_stricmp(sSentence,"q")!=0)
{
ICTCLAS_ParagraphProcess(sSentence,sSentenceResult);
printf("%s/nInput string now!/n",sSentenceResult);
scanf("%s",sSentence);
}
ICTCLAS_Exit();
//Sample2: File segmentation and POS tagging
/*
ICTCLAS_Init();
ICTCLAS_FileProcess("E://Sample//Corpus_NewPOS//199802_Org.txt","E://Sample//Corpus_NewPOS//199802_Org_cla.txt");
ICTCLAS_Exit();
*/
//Sample3: Sentence segmentation and POS tagging with multiple result
/*
char sSentence[2000],**sSentenceResult;
int i;
sSentenceResult=new char*[5];
for(i=0;i<5;i++)
sSentenceResult[i]=new char[5000];
ICTCLAS_Init();
printf("Input sentence now!/n");
scanf("%s",sSentence);
while(_stricmp(sSentence,"q")!=0)
{
ICTCLAS_SentenceProcess(sSentence,5,sSentenceResult);
for(i=0;i<5;i++)
printf("Result%d:%s/n",i+1,sSentenceResult[i]);
printf("Input string now!/n");
scanf("%s",sSentence);
}
ICTCLAS_Exit();
for(i=0;i<5;i++)
delete[] sSentenceResult[i];
delete [] sSentenceResult;
*/
return 0;
}
相关文章推荐
- 中科院ICTCLAS系统,ICTCLAS.dll的函数调用示例(C语言)
- 中科院中文分词C语言接口调用示例
- 使用Java调用中科院分词NLPIR/ICTCLAS
- 使用JAVA调用中科院ICTCLAS2015分词系统
- Eclipse+Java调用中科院分词系统ICTCLAS2016
- 中科院分词(ICTCLAS)Java调用接口下载
- 使用Java调用中科院分词NLPIR/ICTCLAS
- Python调用中科院NLPIR(ICTCLAS2015)详解 刘超(lch614730@163.com)
- jQuery调用RESTful WCF示例代码(GET方法/POST方法)
- 使用套件示例@GTK+ 2.0 中文教程连载 现在我们已经介绍了难的办法,这里介绍怎样用 gtk_item_factory 调用来做。
- vue教程之toast弹框全局调用示例详解
- Python下如何调用NLPIR(ICTCLAS2013)分词系统
- JAVA调用PHP SOAP服务的示例
- java调用shell命令并获取执行结果的示例
- [2014.1.31] Eclipse、MinGW、JNI编写C++生成dll, Java端调用的完整示例(附java.lang.UnsatisfiedLinkError解决方法)
- eclipse JNI示例。利用C/C++实现JAVA中调用的函数
- java 调用 .net webservice 示例
- HttpClient4.5.2调用示例(转载+原创)
- ASP.NET 2.0 AJAX中Webservice调用方法示例
- vue调用百度地图API输入提示示例下拉列表一直被触发问题