Segment.h
上传用户:chen_dj
上传日期:2013-04-22
资源大小:111k
文件大小:2k
- /****************************************************************************
- *
- * Copyright (c) 2000, 2001
- * Machine Group
- * Software Research Lab.
- * Institute of Computing Tech.
- * Chinese Academy of Sciences
- * All rights reserved.
- *
- * This file is the confidential and proprietary property of
- * Institute of Computing Tech. and the posession or use of this file requires
- * a written license from the author.
- * Filename: Segment.cpp
- * Abstract:
- * interface for the CSegment class.
- * Author: Kevin Zhang
- * (zhanghp@software.ict.ac.cn)
- * Date: 2002-4-23
- *
- * Notes: N-Shortest paths Word segmentation
- *
- ****************************************************************************/
- #if !defined(AFX_SEGMENT_H__76DAE34D_434F_4989_8F00_64F17B5E19ED__INCLUDED_)
- #define AFX_SEGMENT_H__76DAE34D_434F_4989_8F00_64F17B5E19ED__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "DynamicArray.h"
- #include "..\Utility\Dictionary.h"
- #include "SegGraph.h"//The segmentation graph
- #define MAX_WORDS 650
- #define MAX_SEGMENT_NUM 10
- class CSegment
- {
- public:
- bool GetLastWord(PWORD_RESULT pItem, char *sWordRet);
- int GetResultCount(PWORD_RESULT pItem);
- bool OptimumSegmet(int nResultCount);
- //Word Segmentation based on optimum segmentation graph
- //After unknown word recognition
- bool Segment(char *sSentence,CDictionary &dictCore,int nResultCount=10);
- CSegment();
- virtual ~CSegment();
- PWORD_RESULT *m_pWordSeg;
- int m_nSegmentCount;
- //The segmentation result
- CDynamicArray m_graphOptimum;//The optimumized segmentation graph
- CSegGraph m_graphSeg;//The segmentation graph
- protected:
- bool IsYearTime(char *sNum);
- bool GenerateWord(int ** nSegRoute, int nIndex);
- };
- #endif // !defined(AFX_SEGMENT_H__76DAE34D_434F_4989_8F00_64F17B5E19ED__INCLUDED_)