⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.cpp

📁 这是一个用C++编写的编译原理的词法分析程序,希望对各位学习编译的同学有一定帮助
💻 CPP
字号:
/****************************************************************************
 *
 * Copyright (c) 2001-2005 Fajava Intelligence Technology (Beijing) Ltd.
 *     
 *     All rights reserved.
 *
 * This file is the confidential and proprietary property of 
 * Fajava Intelligence Technology (Beijing) Ltd.
 *        and the possession or use of this file requires 
 *         a written license from FAJAVA.
 *  Created:	2005-10-18   18:17
 *	File Path:	F:\FITCLAS\FITCLAS30
 * 	Filename: 	Test
 *	File ext:	cpp
 *  
 *  Author:     Fajava Intelligence Technology (Beijing) Ltd.
 *              www.fajava.com; www.fajava.cn
 *  Purpose:	
 *  
 *  History:    1. Created   2005-10-18
 *              2.             
 ****************************************************************************/
#include <string.h>
#include <stdio.h>
#include "TGWS.h"
#ifdef OS_LINUX
	#define _stricmp strcasecmp
#endif

int main()
{
	if(!TGWS_Init())
	{
		printf("Init 3TGWS failed!");
		return 1;
	}



	//////////////////////////////////////////////////////////////////////////
	//
	// Test User-defined Dictionary
	//
	//////////////////////////////////////////////////////////////////////////
	const char * pResult;
	char sInput[2000]="超女纪敏佳深受观众喜爱。禽流感爆发在非典之后。";//
//	//张华平1978年2月1日出生于江西省波阳县。
//	//结合成分子时,

	//////////////////////////////////////////////////////////////////////////
	//
	// Test TGWS_ImportUserDict
	//
	//////////////////////////////////////////////////////////////////////////
/*
	printf("Before User-defined dictionary used:\n");
	pResult=TGWS_ParagraphProcess(sInput);
	printf("Resut: %s\n",pResult);
	int nItem=TGWS_ImportUserDict("Data/UserDict.txt");
	printf("%d Items imported from the User-defined dictionary\n",nItem);
	printf("After User-defined dictionary used:\n");
	pResult=TGWS_ParagraphProcess(sInput);
	printf("Resut: %s\n",pResult);
*/
	//////////////////////////////////////////////////////////////////////////
	//
	// Test TGWS_ParagraphProcess
	//
	//////////////////////////////////////////////////////////////////////////
	printf("Input Sentence Now!(q to quit)\n");
	scanf("%s",sInput);
	//音乐会上还演奏了小提琴协奏曲《梁山伯与祝英台》、
	while (_stricmp(sInput,"q")!=0)
	{
		pResult=TGWS_ParagraphProcess(sInput);
		printf("Resut: %s\nInput Sentence Now!(q to quit)\n",pResult);
		scanf("%s",sInput);
	}
	//////////////////////////////////////////////////////////////////////////
	//
	// Test Speed and File Process
	//
	//////////////////////////////////////////////////////////////////////////
	
//	double dSpeed=FITCLAS_FileProcess("1.txt","1_result.txt");
//	printf("Speed=%fKBytes/s\n",dSpeed);

	TGWS_Exit();

	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -