中文 分词 概念 和 实现 代码 Chinese word segmentation concept and code 2014/8/16 Baofa Chinese word segmentation system Download

Slides:



Advertisements
Similar presentations
Relational Database Systems Higher Information Systems Advanced Implementation in MySQL/PHP.
Advertisements

Lists: An internal look
Comp 122, Spring 2004 Hash Tables – 1. hashtables - 2 Lin / Devi Comp 122, Fall 2003 Dictionary Dictionary: »Dynamic-set data structure for storing items.
A Memory-optimized Bloom Filter using An Additional Hashing Function Author: Mahmood Ahmadi, Stephan Wong Publisher: IEEE GLOBECOM 2008 Presenter: Yu-Ping.
Ics202 Data Structures. hh tail head (b) LinkedList head tail Element datum next 3 Integer Element datum next 1 Integer Element datum next 4 Integer.
Mark Dixon Page 1 23 – Object Oriented Programming in PhP.
Lecture 16. the xsl:variable element The format of the xsl:variable element is or or It tells the XSLT processor to –instantiate the variable with the.
Global Alignment: Dynamic Progamming Table s 1 : acagagtaac s 2 : acaagtgatc -acaagtgatc - a c a g a g t a a c j s2s2 i s1s1 Scores: match=1, mismatch=-1,
Overseas Library Catalog – Request Item Overseas Library Catalog Request loaned item.
PHP (2) – Functions, Arrays, Databases, and sessions.
How to Read the Keyword Results Screen. A keyword search will result in.
Information & Library Services SwetsWise User Guide Emma Crowley Senior Academic Services Librarian
Lists: array implementation list_size = 5 lst Obj 1Obj 2Obj 3Obj 4Obj 5.
Structured Query Language Part I Chapter Three CIS 218.
SQL Exercises1 Revising RDB and SQL CTEC2902 Advanced Programming.
Using ProQuest Databases Jackson Community College Atkinson Library.
©Silberschatz, Korth and Sudarshan3.1Database System Concepts - 6 th Edition SQL Schema Changes and table updates instructor teaches.
1 Insert, Update and Delete Queries. 2 Return to you Address Book database. Insert a record.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
CPS120: Introduction to Computer Science Information Systems: Database Management Nell Dale John Lewis.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
ETD DTD Based on ETD-ML1.1(Virginia Tech) - convert SGML DTD to XML DTD Added some tags -such as TableOfConetents, ListOfPicture, ListOfTables Added “id”
Distributed Systems Lab Lecture -1-.  It is extremely simplified application will be realized with the aid of various middleware technologies.  It allows.
SQL Review Tonga Institute of Higher Education. SQL Introduction SQL (Structured Query Language) a language that allows a developer to work with data.
SQL/lesson 2/Slide 1 of 45 Retrieving Result Sets Objectives In this lesson, you will learn to: * Use wildcards * Use the IS NULL and IS NOT NULL keywords.
Sorting. Why Sort? Put matching elements together –Uniqueness testing –Deleting duplicates –Frequency Counting –Set operations Prioritize Elements Reconstruct.
A SSIGNMENT 1: S IMPLE A RRAY IN J AVA Create 2 Class Accessories Class: MyArray.java Implement an array in Class MyArray Implement a series method to.
ARRAYS 1 Week 2. Data Structures  Data structure  A particular way of storing and organising data in a computer so that it can be used efficiently 
Design and Analysis of Algorithms Dynamic Set Model Haidong Xue Summer 2012, at GSU.
Internet Information Systems Writing to Databases and Amending Data.
Keywords Searching and Analysis System Member Student ID Role 刘亮 Liu Liang System Analyst 顾子俊 Gu Zijun Developer 杜菡菡 Du Hanhan
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
Topic 1: Introduction to SQL. SQL stands for Structured Query Language. SQL is a standard computer language for accessing and manipulating databases SQL.
AFI Top Ten Database Ben English Emma Backman. The Tables.
DT228/3 Web Development Databases. Querying a database: Partial info Search engines, on-line catalogues often need to allow user to search a database.
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
A CCESSING D ATABASES WITH JDBC CH 24 C S 442: A DVANCED J AVA P ROGRAMMING.
CSI 3125, Preliminaries, page 1 Compiling the Program.
Mark Dixon 1 22 – Object Oriented Programming. Mark Dixon 2 Questions: Databases How many primary keys? How many foreign keys? 3 2.
Windows 7 WampServer 2.1 MySQL PHP 5.3 Script Apache Server User Record or Select Media Upload to Internet Return URL Forward URL Create.
WEEK# 12 Haifa Abulaiha November 02,
Dynamic Programming & Memoization. When to use? Problem has a recursive formulation Solutions are “ordered” –Earlier vs. later recursions.
1 Advanced Programming Examples Output. Show the exact output produced by the following code segment. char[,] pic = new char[6,6]; for (int i = 0; i
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To introduce the basic concepts of linked lists ❏ To introduce the basic concepts.
Writing Basic SQL SELECT Statements Lecture
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 7A Arrays (Concepts)
Using Endnotes with ERIC Click Here to Start Tutorial There are 33 slides in this tutorial. Click where directed on the screen to advance the tutorial.
SQL Injection Attacks.
Database Access with SQL
Structured Query Language
CIS 336 AID Your Dreams Our Mission/cis336aid.com
Introduction to CodeIgniter (CI)
Database application MySQL Database and PhpMyAdmin
CIS 336 PAPERS Lessons in Excellence-- cis336papers.com.
'. \s\s I. '.. '... · \ \ \,, I.
Tribal Knowledge Team Undefined Reference to teamName
PowerPoint Mockup of CMS Code Generator
CEV208 Computer Programming
Combining Data Sets in the DATA step.
Writing Basic SQL SELECT Statements
CHAPTER 1: THE DATABASE ENVIRONMENT AND DEVELOPMENT PROCESS
' '· \ ·' ,,,,
Arrays Week 2.
Bear Project Title Name Class Date
For First Place Most Times Up at the Table
Updating Databases With Open SQL
Topic – select statement with ‘between’, ‘not between’ , ‘like’ operators Objective: 1) Able to use between’, ‘not between’ , ‘like’ operators in ‘select’
_______ Book Title #1 Here Book Title #1 Book Title #3 Book Title #5 Book Title #2 Book Title #4 This is an example of what the QR Code will look.
Updating Databases With Open SQL
Presentation transcript:

中文 分词 概念 和 实现 代码 Chinese word segmentation concept and code 2014/8/16 Baofa Chinese word segmentation system Download

create after data[title,content] Chinese word segmentation system et_conversation[$Id,title] new table et_cnword[$Id,title,content] et_post[$Id,content] chinese word tran to urlencode search[keyword] urlencode matching worked fulltext! [association of $Id] Chinese word segmentation system chinese keyword tran to urlencode [view] show result concept Insert Serach

public static function get_idx($words) { require PATH_LIBRARY.'/scws/pscws4.class.php'; $so = new PSCWS4(); $so->set_dict(PATH_LIBRARY.'/scws/dict/dict.xdb'); $so->set_rule(PATH_LIBRARY.'/scws/etc/rules.utf8.ini'); $so->set_charset('utf8'); $so->set_ignore(true); $output = ''; $so->send_text($key); while ($tmp = $so->get_result()) { foreach ($tmp as $item) { $output.= $item['word']. ' '; } $so->close(); // delete empty array $data = array_filter(explode(" ",$output)); // delete duplicates $data = array_flip(array_flip($data)); // string to urlencode part $data_code = ''; foreach ($data as $ss) { if (strlen($ss) > 1) { $data_code.= $ss. ' '; //$data_code.= str_replace('%','',urlencode($ss)). ' '; } return $data_code; } Chinese word segmentation system Class

public function add($title,$detail, $askerid) { $date= NOW; $sql= 'INSERT INTO questions '. '(title, detail, askerid, date) '. 'values '. "('$title', '$detail', $askerid, '$date')"; $result= $this->db->query($sql); $id= $this->db->lastId(); // Chinese word segmentation Class $title_idx= CWS::get_idx($title); $detail_idx= CWS::get_idx(strip_tags($detail)); $sql= 'INSERT INTO questions_idx '. '(id, title, detail) '. 'values '. "($id, '$title_idx', '$detail_idx')"; $this->db->query($sql); return$result; } Chinese word segmentation system Insert

public function search($word,$limit) { $word= CWS::get_idx($word); $sql= "SELECT A.title, A.detail, askerid, date ". "FROM questions as A, questions_idx as B ". "WHERE A.id = B.id ". "AND MATCH (B.title, B.detail) AGAINST ('$word')"; $result= $this->db->getAll($sql,$limit); return$result; } Chinese word segmentation system Search