SlideShare a Scribd company logo
1 of 53
Download to read offline
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
mysql> CREATE TABLE t1 (
                     >   c1 INT PRIMARY KEY,
                     >   c2 TEXT,
                     >   _score FLOAT,
                     >   FULLTEXT INDEX (c2)
                     > ) ENGINE = groonga DEFAULT CHARSET utf8;
                Query OK, 0 rows affected (0.22 sec)




2011   3   28
mysql> insert into t1 values(1, "aa ii uu ee oo", null);
                Query OK, 1 row affected (0.00 sec)
                mysql> insert into t1 values(2, "aa ii ii ii oo", null);
                Query OK, 1 row affected (0.00 sec)
                mysql> insert into t1 values(3, "dummy", null);
                Query OK, 1 row affected (0.00 sec)

                mysql> select * from t1 where match(c2) against("ii")
                order by _score desc;
                +----+----------------+--------+
                | c1 | c2             | _score |
                +----+----------------+--------+
                | 2 | aa ii ii ii oo |       3 |
                | 1 | aa ii uu ee oo |       1 |
                +----+----------------+--------+
                2 rows in set (0.00 sec)


2011   3   28
2011   3   28
2011   3   28
package main {
                    no utf8;

                    my $path = 'tag_keys.db';
                    my $pat = Groonga::PatriciaTrie->new;
                    if (! $pat->open($path)) {
                        $pat->create($path, 1024, 1024,
                GRN_OBJ_KEY_VAR_SIZE | GRN_OBJ_KEY_NORMALIZE)
                            or die 'Groonga::PatriciaTrie create error';
                    }
                    $pat->add('   ', '');
                    $pat->add('muteki', '');
                    $pat->add('yappo', '');

                    my $text = 'muTEki           Yappo <>     ';
                    my $replace = $pat->tag_keys($text, sub {
                        my($record, $word, $record_id) = @_;
                        sprintf '<span class="keyword">%s(%s)</span>',
                $record, $word;
                    });

                    say $replace;
                }

                __END__
2011   3   28   <span class="keyword">muTEki(muteki)</span>
2011   3   28
2011   3   28

More Related Content

What's hot

Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB jhchabran
 
หน่วย2 เซลล์ไฟฟ้า
หน่วย2 เซลล์ไฟฟ้าหน่วย2 เซลล์ไฟฟ้า
หน่วย2 เซลล์ไฟฟ้าPornsak Tongma
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidSomenath Mukhopadhyay
 
Php reference sheet
Php reference sheetPhp reference sheet
Php reference sheetSilvia Rios
 
Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPaweł Dawczak
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6Andrew Shitov
 
Research options for studying tenure security
Research options for studying tenure securityResearch options for studying tenure security
Research options for studying tenure securityCIFOR-ICRAF
 
令和から本気出す
令和から本気出す令和から本気出す
令和から本気出すTakashi Kitano
 
Family Office White Paper: ETF Strategies
Family Office White Paper: ETF StrategiesFamily Office White Paper: ETF Strategies
Family Office White Paper: ETF StrategiesPerlman Family Office
 
Design pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and MementoDesign pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and MementoSean Tsai
 
Les polynômes formels à une indéterminée à coefficients dans un corps K
Les polynômes formels à une indéterminée à coefficients dans un corps KLes polynômes formels à une indéterminée à coefficients dans un corps K
Les polynômes formels à une indéterminée à coefficients dans un corps KAchraf Ourti
 
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析Takashi Kitano
 
{tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver)
{tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver){tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver)
{tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver)Takashi Kitano
 
hotel managment
hotel managmenthotel managment
hotel managmentMelk Biks
 
Python avanzado - parte 1
Python avanzado - parte 1Python avanzado - parte 1
Python avanzado - parte 1coto
 
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグインPhpで作るmovable typeプラグイン
Phpで作るmovable typeプラグインYuji Takayama
 
PHP webboard
PHP webboardPHP webboard
PHP webboardtumetr1
 
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Codemotion
 

What's hot (20)

Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
 
หน่วย2 เซลล์ไฟฟ้า
หน่วย2 เซลล์ไฟฟ้าหน่วย2 เซลล์ไฟฟ้า
หน่วย2 เซลล์ไฟฟ้า
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
 
Php reference sheet
Php reference sheetPhp reference sheet
Php reference sheet
 
Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to Elixir
 
Coim
CoimCoim
Coim
 
Creating a compiler in Perl 6
Creating a compiler in Perl 6Creating a compiler in Perl 6
Creating a compiler in Perl 6
 
Research options for studying tenure security
Research options for studying tenure securityResearch options for studying tenure security
Research options for studying tenure security
 
令和から本気出す
令和から本気出す令和から本気出す
令和から本気出す
 
Family Office White Paper: ETF Strategies
Family Office White Paper: ETF StrategiesFamily Office White Paper: ETF Strategies
Family Office White Paper: ETF Strategies
 
Design pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and MementoDesign pattern - Iterator, Mediator and Memento
Design pattern - Iterator, Mediator and Memento
 
Les polynômes formels à une indéterminée à coefficients dans un corps K
Les polynômes formels à une indéterminée à coefficients dans un corps KLes polynômes formels à une indéterminée à coefficients dans un corps K
Les polynômes formels à une indéterminée à coefficients dans un corps K
 
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
{tidytext}と{RMeCab}によるモダンな日本語テキスト分析
 
{tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver)
{tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver){tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver)
{tidygraph}と{ggraph}による モダンなネットワーク分析(未公開ver)
 
hotel managment
hotel managmenthotel managment
hotel managment
 
Python avanzado - parte 1
Python avanzado - parte 1Python avanzado - parte 1
Python avanzado - parte 1
 
Phpで作るmovable typeプラグイン
Phpで作るmovable typeプラグインPhpで作るmovable typeプラグイン
Phpで作るmovable typeプラグイン
 
PHP webboard
PHP webboardPHP webboard
PHP webboard
 
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
Matteo Antony Mistretta - Refactoring into React hooks - Codemotion Rome 2019
 
Manual de sistemas
Manual de sistemasManual de sistemas
Manual de sistemas
 

Viewers also liked

API Gateway + LambdaでLINE通知サービス構築
API Gateway + LambdaでLINE通知サービス構築API Gateway + LambdaでLINE通知サービス構築
API Gateway + LambdaでLINE通知サービス構築Ken'ichirou Kimura
 
Ranking system by Elasticsearch
Ranking system by ElasticsearchRanking system by Elasticsearch
Ranking system by ElasticsearchKazuhiro Osawa
 
趣味でサービスを作った話
趣味でサービスを作った話趣味でサービスを作った話
趣味でサービスを作った話Takumi KASHIMA
 
コミュニティーハッピーアワーLt資料161214
コミュニティーハッピーアワーLt資料161214コミュニティーハッピーアワーLt資料161214
コミュニティーハッピーアワーLt資料161214Hayai Hirokazu
 
Fukuoka pm #27 LINE BOT API With Perl
Fukuoka pm #27 LINE BOT API With PerlFukuoka pm #27 LINE BOT API With Perl
Fukuoka pm #27 LINE BOT API With PerlKazuhiro Osawa
 
LINE BOT on the Perl (YAPC::Hokkaido ver.)
LINE BOT on the Perl (YAPC::Hokkaido ver.)LINE BOT on the Perl (YAPC::Hokkaido ver.)
LINE BOT on the Perl (YAPC::Hokkaido ver.)Kazuhiro Osawa
 
正しい開発をする
正しい開発をする正しい開発をする
正しい開発をするHonMarkHunt
 
LINE Messaging apiと戯れる
LINE Messaging apiと戯れるLINE Messaging apiと戯れる
LINE Messaging apiと戯れるHonMarkHunt
 
Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話
Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話
Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話LINE Corporation
 
S3 chat bot & the new world
S3 chat bot & the new worldS3 chat bot & the new world
S3 chat bot & the new worldLINE Corporation
 
Line messaging api ハンズオン資料 ver1.2
Line messaging api ハンズオン資料 ver1.2Line messaging api ハンズオン資料 ver1.2
Line messaging api ハンズオン資料 ver1.2hajime sato
 

Viewers also liked (14)

API Gateway + LambdaでLINE通知サービス構築
API Gateway + LambdaでLINE通知サービス構築API Gateway + LambdaでLINE通知サービス構築
API Gateway + LambdaでLINE通知サービス構築
 
Ranking system by Elasticsearch
Ranking system by ElasticsearchRanking system by Elasticsearch
Ranking system by Elasticsearch
 
趣味でサービスを作った話
趣味でサービスを作った話趣味でサービスを作った話
趣味でサービスを作った話
 
コミュニティーハッピーアワーLt資料161214
コミュニティーハッピーアワーLt資料161214コミュニティーハッピーアワーLt資料161214
コミュニティーハッピーアワーLt資料161214
 
Subramanya Rai Resume
Subramanya Rai ResumeSubramanya Rai Resume
Subramanya Rai Resume
 
Linebot
LinebotLinebot
Linebot
 
Fukuoka pm #27 LINE BOT API With Perl
Fukuoka pm #27 LINE BOT API With PerlFukuoka pm #27 LINE BOT API With Perl
Fukuoka pm #27 LINE BOT API With Perl
 
LINE BOT on the Perl (YAPC::Hokkaido ver.)
LINE BOT on the Perl (YAPC::Hokkaido ver.)LINE BOT on the Perl (YAPC::Hokkaido ver.)
LINE BOT on the Perl (YAPC::Hokkaido ver.)
 
正しい開発をする
正しい開発をする正しい開発をする
正しい開発をする
 
LINE Messaging apiと戯れる
LINE Messaging apiと戯れるLINE Messaging apiと戯れる
LINE Messaging apiと戯れる
 
Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話
Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話
Akka ActorとAMQPでLINEのメッセージングパイプラインをリプレースした話
 
S2 messaging api
S2 messaging apiS2 messaging api
S2 messaging api
 
S3 chat bot & the new world
S3 chat bot & the new worldS3 chat bot & the new world
S3 chat bot & the new world
 
Line messaging api ハンズオン資料 ver1.2
Line messaging api ハンズオン資料 ver1.2Line messaging api ハンズオン資料 ver1.2
Line messaging api ハンズオン資料 ver1.2
 

Similar to Yappo Groonga - with japanese search software history @ osdc.tw 2011

8 tonnes sustainable_household_consumption
8 tonnes sustainable_household_consumption8 tonnes sustainable_household_consumption
8 tonnes sustainable_household_consumptionMichael Lettenmeier
 
Metadata Matters
Metadata MattersMetadata Matters
Metadata Mattersafa reg
 
Cassandra summit keynote 2014
Cassandra summit keynote 2014Cassandra summit keynote 2014
Cassandra summit keynote 2014jbellis
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald PartitioningInSync Conference
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsPierre MARTIN
 
PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007Damien Seguy
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2Amzad Hossain
 
PHP security audits
PHP security auditsPHP security audits
PHP security auditsDamien Seguy
 
[INSIGHT OUT 2011] B24 effective indexing(tom kyte)
[INSIGHT OUT 2011] B24 effective indexing(tom kyte)[INSIGHT OUT 2011] B24 effective indexing(tom kyte)
[INSIGHT OUT 2011] B24 effective indexing(tom kyte)Insight Technology, Inc.
 
An Introduction to Part of C++ STL
An Introduction to Part of C++ STLAn Introduction to Part of C++ STL
An Introduction to Part of C++ STL乐群 陈
 
The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202Mahmoud Samir Fayed
 
Optimizer features in recent releases of other databases
Optimizer features in recent releases of other databasesOptimizer features in recent releases of other databases
Optimizer features in recent releases of other databasesSergey Petrunya
 

Similar to Yappo Groonga - with japanese search software history @ osdc.tw 2011 (20)

8 tonnes sustainable_household_consumption
8 tonnes sustainable_household_consumption8 tonnes sustainable_household_consumption
8 tonnes sustainable_household_consumption
 
Metadata Matters
Metadata MattersMetadata Matters
Metadata Matters
 
Cassandra summit keynote 2014
Cassandra summit keynote 2014Cassandra summit keynote 2014
Cassandra summit keynote 2014
 
Into Clojure
Into ClojureInto Clojure
Into Clojure
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald Partitioning
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 
PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007PHP and MySQL Tips and tricks, DC 2007
PHP and MySQL Tips and tricks, DC 2007
 
Introduction To Lamp P2
Introduction To Lamp P2Introduction To Lamp P2
Introduction To Lamp P2
 
PHP security audits
PHP security auditsPHP security audits
PHP security audits
 
[INSIGHT OUT 2011] B24 effective indexing(tom kyte)
[INSIGHT OUT 2011] B24 effective indexing(tom kyte)[INSIGHT OUT 2011] B24 effective indexing(tom kyte)
[INSIGHT OUT 2011] B24 effective indexing(tom kyte)
 
2 d matrices
2 d matrices2 d matrices
2 d matrices
 
C99
C99C99
C99
 
wreewrer
wreewrerwreewrer
wreewrer
 
An Introduction to Part of C++ STL
An Introduction to Part of C++ STLAn Introduction to Part of C++ STL
An Introduction to Part of C++ STL
 
4sem dbms(1)
4sem dbms(1)4sem dbms(1)
4sem dbms(1)
 
The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202The Ring programming language version 1.8 book - Part 66 of 202
The Ring programming language version 1.8 book - Part 66 of 202
 
Ruby things
Ruby thingsRuby things
Ruby things
 
Hanya contoh saja dari xampp
Hanya contoh saja dari xamppHanya contoh saja dari xampp
Hanya contoh saja dari xampp
 
Optimizer features in recent releases of other databases
Optimizer features in recent releases of other databasesOptimizer features in recent releases of other databases
Optimizer features in recent releases of other databases
 

Yappo Groonga - with japanese search software history @ osdc.tw 2011

  • 1. 2011 3 28
  • 2. 2011 3 28
  • 3. 2011 3 28
  • 4. 2011 3 28
  • 5. 2011 3 28
  • 6. 2011 3 28
  • 7. 2011 3 28
  • 8. 2011 3 28
  • 9. 2011 3 28
  • 10. 2011 3 28
  • 11. 2011 3 28
  • 12. 2011 3 28
  • 13. 2011 3 28
  • 14. 2011 3 28
  • 15. 2011 3 28
  • 16. 2011 3 28
  • 17. 2011 3 28
  • 18. 2011 3 28
  • 19. 2011 3 28
  • 20. 2011 3 28
  • 21. 2011 3 28
  • 22. 2011 3 28
  • 23. 2011 3 28
  • 24. 2011 3 28
  • 25. 2011 3 28
  • 26. 2011 3 28
  • 27. 2011 3 28
  • 28. 2011 3 28
  • 29. 2011 3 28
  • 30. 2011 3 28
  • 31. 2011 3 28
  • 32. 2011 3 28
  • 33. 2011 3 28
  • 34. 2011 3 28
  • 35. 2011 3 28
  • 36. 2011 3 28
  • 37. 2011 3 28
  • 38. 2011 3 28
  • 39. 2011 3 28
  • 40. 2011 3 28
  • 41. 2011 3 28
  • 42. 2011 3 28
  • 43. 2011 3 28
  • 44. 2011 3 28
  • 45. 2011 3 28
  • 46. 2011 3 28
  • 47. mysql> CREATE TABLE t1 ( > c1 INT PRIMARY KEY, > c2 TEXT, > _score FLOAT, > FULLTEXT INDEX (c2) > ) ENGINE = groonga DEFAULT CHARSET utf8; Query OK, 0 rows affected (0.22 sec) 2011 3 28
  • 48. mysql> insert into t1 values(1, "aa ii uu ee oo", null); Query OK, 1 row affected (0.00 sec) mysql> insert into t1 values(2, "aa ii ii ii oo", null); Query OK, 1 row affected (0.00 sec) mysql> insert into t1 values(3, "dummy", null); Query OK, 1 row affected (0.00 sec) mysql> select * from t1 where match(c2) against("ii") order by _score desc; +----+----------------+--------+ | c1 | c2 | _score | +----+----------------+--------+ | 2 | aa ii ii ii oo | 3 | | 1 | aa ii uu ee oo | 1 | +----+----------------+--------+ 2 rows in set (0.00 sec) 2011 3 28
  • 49. 2011 3 28
  • 50. 2011 3 28
  • 51. package main {     no utf8;     my $path = 'tag_keys.db';     my $pat = Groonga::PatriciaTrie->new;     if (! $pat->open($path)) {         $pat->create($path, 1024, 1024, GRN_OBJ_KEY_VAR_SIZE | GRN_OBJ_KEY_NORMALIZE)             or die 'Groonga::PatriciaTrie create error';     }     $pat->add(' ', '');     $pat->add('muteki', '');     $pat->add('yappo', '');     my $text = 'muTEki Yappo <> ';     my $replace = $pat->tag_keys($text, sub {         my($record, $word, $record_id) = @_;         sprintf '<span class="keyword">%s(%s)</span>', $record, $word;     });     say $replace; } __END__ 2011 3 28 <span class="keyword">muTEki(muteki)</span>
  • 52. 2011 3 28
  • 53. 2011 3 28