Performing searches against large dictionaries using php - php

Currently I am trying to perform text searches against large dictionaries using php or mysql. Until now I haven't found the best way to do that. For example there is a Text:Scan module written in Perl
http://search.cpan.org/~iwoodhead/Text-Scan-0.28/Scan.pm
which is exactly what I need for php. If you are aware of some way to do that in php please share this knowledge with me! :)
Thanks for Your help!

As far as I understood, what you may need is something like Zend_Search_Lucene. You will get more information from http://framework.zend.com/manual/en/zend.search.lucene.overview.html

Have a look at Sphinx.
We are using it in one of our projects and it's serving well.
Moreover PHP has PECL extension for it.

MySQL has in-built support for full-text indexing and search:
here. This might be what you are looking for

Related

Easiest way to create a table with Zend_Pdf

What's the easyiest way to create a table with Zend_Pdf?
Until now, i realized tables with horizontal and vertical lines. Is there no other solution for tables?
Thank you.
There's this project in SF: http://zendpdftable.sourceforge.net/
However it's still not very practical, compared to other libraries.
I've also found a Zend_Pdf_Helper gitHub project that maybe can help someone.
From what i have read there is no easy way to do this. The closest you will get is by using the shape drawing primitives in the Zend_Pdf API or (probably better) by switching to another PDF library entirely.
XSL:FO combined with FOP handles tables very nicely. The downside is that it is an external too, seems to be slightly dated, and documentation for it is not the greatest. This posting of mine might help: http://grover.open2space.com/content/creating-pdf-code-fop

Code to parse user agent string?

As strange as I find this, I have not been able to find a good PHP function anywhere which will do an intelligent parse of a user agent string? Googled it for about 20 minutes now.
I have the string already, I just need something that will chop it up and give me at least browser/ver/os.
Know of a good snippet anywhere?
The get_browser() function has been available in PHP for quite a long a time.
The PHP manual is free, can be downloaded in various formats and viewed online (with comments)
https://github.com/browscap/browscap-php - this is a standalone library that aims to replace get_browser function. For shared hostings it seems to be a better option.
Works on: PHP 5
You can try to use: https://github.com/tobie/ua-parser. This is multi-language tool to parsing user agent string. For PHP is here: https://github.com/tobie/ua-parser/tree/master/php
Try out ThaDafinser/UserAgentParser it's an abstraction for many available user agent parsers.
So if you are not happy with one - just switch to another (or combine them)
You can try it out here
There is a PHP class library i found out, and it has worked so well for me. It is in the link below.
https://www.toms-world.org/blog/parseuseragentstring
It is lightweight and just does what I wanted (Browser, Version, OS, Mobile/PC, and much more) in a memory-friendy manner.

how do i compare 2 html pages, and output only the different bits in ruby or PHP?

how can i get 2 pages, and output the difference between those. getting the pages not a problem, but stuck on how to get the difference....i need a library for ruby OR php
thank you.
http://us3.php.net/manual/en/function.xdiff-string-diff.php
Not exactly what you asked for, but you might find it interesting and/or useful, but there is a Javascript diff library which might work for your needs.
For PHP, I'd suggest looking at the daisydiff project. This work was done to create a visual diff for Mediawiki.
Otherwise, the easiest thing to do would be to shell out to the diff program, and transform the results into html.

"Universal" search engine for PHP examples

There are a lot of web sites for for PHP developers to copy scripts from. I wonder if there is a "universal" search engine to search examples from all of these sites? Something like a Google custom search engine which searches PHP examples from good web sites. My wife needs a tool like that and I guess this question should be sent to the PHP gurus here. Thank you in advance.
BTW, There is a useful search engine for Java examples here: http://www.google.com/coop/cse?cx=004472050566847039233:9ld3aazskua
JB
What about http://www.google.com/codesearch?
you can try this one
http://www.koders.com/
For Google, start you search term with filetype:phps <?php to search for source files.
Php search for foo.
There is also http://www.krugle.com/
On the PHPClasses website you can find a class for just about everything, and it has the search capability.
I have always found that php.net have great examples. and if there isn't something in the main article the comments will usually have what your looking for.
You can view the massive list of functions here: http://www.php.net/quickref.php
for people just starting to learn php then W3Schools is an excellent recourse.
I also used TiZag greatly when I learnt php
(just do a google search for W3Schools or TiZag)

i look some example of using Swish Search Engine Extension in php

did somebody use this Extension in php or have an example of code,
edit :
i want to hear an opinion on this Extension if somebody deal with it.
a tutorial with code , large examples ..
Is this what you're looking for?
http://us3.php.net/manual/en/book.swish.php You can even find example code.
I haven't used swish myself though so I can't vouch for it. I have, however, been pleasantly surprised with Sphinx
I'll google it for you, you lazy jerk
http://www.pixel2life.com/tutorials/swish_and_swishmax/swish_with_php_mysql/
=)

Categories