捐赠 | 广告 | 注册 | 发布精品源码 | 上传 | 关于我们    
  沪ICP备05001939号 DELPHI盒子 | 盒子论坛 | 盒子文章 | 盒子问答悬赏 | 最新更新 | 论坛检索 | 下载中心 | 高级搜索    
  精品专区 | 繁體中文 | 奖励公告栏 | 直通车账号登陆 | 关闭GOOGLE广告 | 临时留言    
盒子资源分类
全部展开 - 全部合拢
【精品源码】 SCWS中文分词系统Delphi接口封装(含字典和动态链接库)
关键字:中文 分词 Delphi 字典
来 自:精品
平 台:Win9x,Win2K/2003/NT/XP,Vista/WIN7 下载所需:5 火柴
深浅度:中级 完成时间:2013/4/8
发布者:chineseswish (奖励80火柴) 发布时间:2013/4/12
编辑器:Delphi2005/6/7 语  种:简体中文
分 类:字符串 下载浏览:139/15559
加入到我的收藏
下载错误报错
登陆以后才能下载
 用户名:
 密 码:
自动登陆(30天有效)
图片如果打不开,说明流量不够了,请稍候下载……
【解压密码:QDAC】
type
  TWordMultiCutMode=(mcmShort,mcmDuality,mcmZMain,mcmZAll);
  TWordMultiCutModes=set of TWordMultiCutMode;
  PSCWSResultItem=^TSCWSResultItem;
  TSCWSResultItem=packed record
    Offset:Integer;
    Idf:single;
    Len:Byte;
    Attr:array[0..2] of AnsiChar;
    Next:PSCWSResultItem;
  end;
  PSCWSTopWordItem=^TSCWSTopWordItem;
  TSCWSTopWordItem=packed record
    Text:PAnsiChar;//
    Weight:single;
    Times:Smallint;
    Attr:array[0..1] of AnsiChar;
    Next:PSCWSTopWordItem;
  end;

  TSCWSWordParser=class;
  TSCWSTopWords=class;
  TSCWSResult=class;
  TSCWSWordParser=class
  private
    FRuleFile: String;
    FHandle:THandle;
    FFlags:Integer;
    FCharset:String;
    function GetDuality: Boolean;
    function GetEnableIgnore: Boolean;
    procedure SetCharset(const Value: String);
    procedure SetDuality(const Value: Boolean);
    procedure SetEnableIgnore(const Value: Boolean);
    procedure SetRuleFile(const Value: String);
    function GetMultiCut: TWordMultiCutModes;
    procedure SetMultiCut(const Value: TWordMultiCutModes);
  protected
    constructor Create(AParent:TSCWSWordParser);overload;
  public
    constructor Create;overload;
    destructor Destroy;override;
    function Fork:TSCWSWordParser;
    function AddDict(AFileName:String;ALoadToMemory:Boolean):Boolean;
    function ReplaceDict(AFileName:String;ALoadToMemory:Boolean):Boolean;
    function Parse(S:String):TSCWSResult;
    function Tops(AMaxItem:Integer;AMask:String):TSCWSTopWords;
    property EnableIgnore:Boolean read GetEnableIgnore write SetEnableIgnore;
    property Charset:String read FCharset write SetCharset;
    property RuleFile:String read FRuleFile write SetRuleFile;
    property MultiModes:TWordMultiCutModes read GetMultiCut write SetMultiCut;
    property Duality:Boolean read GetDuality write SetDuality;
  end;
  TSCWSResult=class
  private
    function GetAttr: String;
    function GetBof: Boolean;
    function GetEof: Boolean;
    function GetIdf: Single;
    function GetLength: Integer;
    function GetOffset: Integer;
    function GetText: String;
  protected
    FHandle:THandle;
    FActive:PSCWSResultItem;
    FOwner:TSCWSWordParser;
    FSource:String;
  published
  public
    constructor Create(AOwner:TSCWSWordParser);overload;
    destructor Destroy;override;
    procedure First;
    function Next:Boolean;
    function NextWord:Boolean;
    property Text:String read GetText;
    property Offset:Integer read GetOffset;
    property Idf:Single read GetIdf;
    property Length:Integer read GetLength;
    property Attr:String read GetAttr;
    property Eof:Boolean read GetEof;
    property Bof:Boolean read GetBof;
  end;

  TSCWSTopWords=class
  private
    function GetAttr: String;
    function GetBof: Boolean;
    function GetEof: Boolean;
    function GetText: String;
    function GetTimes: Integer;
    function GetWeight: Single;
  protected
    FHandle:THandle;
    FActive:PSCWSTopWordItem;
    FOwner:TSCWSWordParser;
  published
  public
    constructor Create(AOwner:TSCWSWordParser);overload;
    destructor Destroy;override;
    procedure First;
    function Next:Boolean;
    property Text:String read GetText;
    property Weight:Single read GetWeight;
    property Times:Integer read GetTimes;
    property Attr:String read GetAttr;
    property Eof:Boolean read GetEof;
    property Bof:Boolean read GetBof;
  end;
Google
 
本站原创作品,未经作者许可,严禁任何方式转载;转载作品,如果侵犯了您的权益,请联系我们
龙脉加密锁 15元起 Grid++Report 报表 申请支付@网
 相关文章
没有相关文章
相关评论
共有评论10条 当前显示最后6条评论
hackermo 2013/4/25 14:15:20
我测试每次Parse只能分255个字符?
isxuzhu 2013/5/3 20:42:38
下不了,没火柴
isxuzhu 2013/5/19 0:15:15
XE4测试结果显示有问题,取出不完整
5xiaoxi2 2014/1/2 14:06:16
下不了,没火柴
ouweining 2014/3/30 9:24:42
XE5下测试也有问题,取出不完整...谁能教一下,如何取完整.谢谢!
hackering 2015/1/29 12:20:02
DELPH7+win7
下测试无用
我要发表评论 查看全部评论
 
  DELPHI盒子版权所有 1999-2023 V4.01 粤ICP备10103342号-1 更新RSS列表