Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I would like to find a way to be able to split a word into syllables with PHP. For example, the word "nevermore" ran through detect_syllables(), would return "nev-er-more." Are there any good APIs or something out there?
There's a useful PHd thesis paper by Frank Liang that describes an exceptionally accurate algorithm for this: written over 25 years ago, it's still valid. But I'm not aware of any implementation in PHP
EDIT
A quick google has identified this link to a Text Statistics library in PHP, which includes algorithms for syllable counting within words (among other readability measuring algorithms). You should be able to find the code for syllable splitting here.
I'm actually in the finishing stages of making a PHP Hyphenator class based upon Frank Liang's algorithm and the TeX dictionaries, which pretty much seems to be the appoach taken by all office suites. (Actually I found this topic while looking for a good name for it that wasn't already taken). With slowly improving support from browsers for the entity, it's becoming a realistic option to hyphenate content in websites.
Core functionality is working; splitting (and thus counting) and/or hyphenating text and/or HTML, parsing TeX hyphen dictionaries, caching those parsed dictionaries. Some planned features are still missing but nothing that stops you from using it. Also there's no good documentation, samples, formal unittest or vanity site yet.
I've created a github site for it here and will post the current version on it ASAP, so check back in a few days.
I've only tested it with Dutch (my native language) and US English, so it may still have some issues with languages using different character sets.
Note that Frank Liang's paper is on hyphenation, NOT on syllable detection. In addition, his thesis paper itself states that its success rate is around 89% for the dictionary he used, which is not going to be good enough for everyone. There really is no substitute for manually doing it for every single word it seems. It's not that efficient to have to require a complete one-to-one lookup table wordlist in order to do it, but these days storage space is far less expensive than CPU time anyways.
Perhaps someone might consider making a CAPTCHA-like service so that many users could be asked to provide the solution to every known word, with the results checked against each other, so that one person wouldn't have to do it all themselves. I'd hope the results would be released freely once complete.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
Something I've never understood is why do people refer to code as being "Baked"? For example on the Codeigniter home page the term "A Fully Baked PHP Framework" is used and its something I see quite often. Does the word "baked" have any meaning behind it?
This probably belongs on a different site (there's an English Usage Stack Exchange site I think?), but since it's bubbled to the top...
The word "baked" has a lot of meanings and uses, several of which can provide useful metaphors for aspects of programming:
baking involves combining ingredients, following a recipe, and ending up with something more than the sum of its parts
when you bake something in an oven, you first finish preparing the raw mixture; when your source code is ready to compile, it is ready to bake
once something is "baked in", it is hard or impossible to change it, since baking is not reversible
"half-baked" means an idea that is not fully thought through; "fully baked" therefore implies the contrary
"a piece of cake" means "extremely easy", which is the likely inspiration for the name CakePHP, which I believe was first developed when "Ruby on Rails" was the hip new thing
The sentence you cite is drawing on several of these meanings to make a good soundbite; the implication is that other frameworks can't live up to them, and it's probably no coincidence that one of those rivals is CakePHP.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I work for a building where people check in when they arrive, and are supposed to check out when they leave. It's necessary for:
Fire regulations
It tells the receptionist whether the visitor's membership is valid
The marketing team want to use it for CRM
At present, the visitor checks in by scanning their membership card with a barcode reader, and speaks to the receptionist to check out. However, this process is really inefficient for both visitors and the receptionist, and so the data is usually quite inaccurate.
I'm looking for solutions that are a bit more robust. Obviously, I could build something, but I'm wondering if there is some kind of open source solution already out there. It would need to have an API to integrate with the other existing systems.
I was able to find one open source project: PHPTimeClock
After a short code review, I noticed that it does not have top notch coding practices. However it does offer a quick way to kickstart a similar project and at the very least gives some idea on where to start.
It also is not actively maintained (considering the last/only commit was 7 months ago).
Taken from ohloh.net:
Originally founded by Ken Papizan, PhpTimeClock grew to be an easy to use and stable time-clock solution for many companies. After a short while of inactivity the project was revived and given new life in the form of a new website and new code. PhpTimeClock strives to become the premiere open source time-clock solution, suitable for small companies and large enterprises.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Is there any tool available that takes C code as input and outputs valid PHP files?
I'd like to use the SAC API but all the implementations currently available are in C, Java, Ruby and Perl. I wonder if the C implementation can be converted to PHP easily.
I've never seen any tool to do that ; but the way that's generally used when one wants to use some C library from PHP is to write a PHP extension, that acts as some kind of "bridge" between the PHP userland-code, and the C library.
That's how you are able to use the curl library from PHP, for example.
A couple of interesting reads on that matter :
Extension Writing Part I: Introduction to PHP and Zend
Extension Writing Part II: Parameters, Arrays, and ZVALs
Extension Writing Part II: Parameters, Arrays, and ZVALs [continued]
Extension Writing Part III: Resources
Wrapping C++ Classes in a PHP Extension
And, if you are really interested by the subject, and ready to spend some money on it, you could also buy the book Extending and Embedding PHP (some pages are available as preview on Google Books too) ; I've seen a couple of times that it was the book to read when interested on this subject (In fact, I've bought it some time ago, and it's an interesting read, even if you don't plan on writing an extension right now)
BTW, the author of that book is also the author of the first four articles I linked to ;-)
The answer is The simplified wrapper and interface generator
It's a huge library and tool and has a steep learning curve so maybe you should ask yourself if the API you want to wrap is really complicated enough to use SWIG or if it's not faster to do it manually.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Can anyone suggest a CMS able to offer the following features:
Free/open source
Support for multiple languages (both frontend and backend)
Support for translating content (i.e. an article can have 1+ translations)
Support for different content types, namely pages, articles (timestamped, with comments) and image (galleries).
Support for basic categorization (just a level of sections is sufficient)
Support for media management (localizable image galleries)
User friendly
lightweight and fast
PHP or Ruby based
mature enough
Personally, I can only think of Drupal 6, but it's quite an overkill for what I want to do, and localization is not working 100%. I basically can live with anything which was built from the ground up with localization in mind.
After days of looking around and tryng out various demo site, SPIP seems to be the only proper solution to my problem. Any other idea?
Daisy was built from the ground-up with localization in mind.
In Daisy, each document can have one or more language variants, and Daisy tracks whether the source document and the translated variant are in-sync or not. This makes it very easy to manage change.
For example, I can ask Daisy 'Give me a list of documents for which either the Japanese translation doesn't exist, or it is not longer in sync with the original'. You can do this for any file type, including screenshots.
I think it hits all of your requirements except that it's built on the Java stack.
How about Joomla? I'm not sure if it fulfills all your requirements, but it's a suggestion nonetheless.
Probably under-kill, but WordPress with the qTranslate plugin works well for i18n of the admin interface plus the main content block of your page.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I would like to know some good resources (book or website) on learning PHP for those who are already familiar with programming.
Many of the tutorials I've been finding are for people who never programmed before and take way to long to go through to even learn basic language constructs.
The optimal resource would not assume previous web-development background however.
The PHP Manual is what I used, especially with the search box in Firefox. Type in a function name and go. If you haven't already, it's probably worth browsing through while you wait for more answers.
Learning raw PHP is probably the wrong way to go if you're already an experienced programmer. I'd recommend picking up one of the frameworks, such as PHP Cake, Code Ignitor or Symfony. These frameworks attempt to enforce the set of best-practices that have developed for PHP developers over the past six or seven years.
To that end, Symfony has a great, "24 hours" style tutorial that can get you up and running with their framework, which will sneakily expose you to writing PHP code. Even if you decide you don't like symfony, concepts such as MVC, routing, templating, ORM, etc. will be covered. The other frameworks have similar tutorials, but I like the 24, one hour lessons approach.
For questions on specific PHP core functions/classes, php.net serves as a good resource (although the document of some of the core helper classes like XMLReader and the Reflection hierarchy can be sparse).
This site has some good stuff:
http://tizag.com
Whenever I am teaching anybody stuff I tell them to just Google "php [insert what you want to do]" and it will usually be in the first few results.
Another option:
http://php.net
Use http://www.w3schools.com. They've got a great tutorial for beginning and intermediate php programmers. Also, the PHP Manual is fantastic.
I definitely use the official site at php.net and O'Reilly's PHP Cookbook most often.
As well, the zend development zone, http://devzone.zend.com/public/view and
Manning's PHP in Action book are useful resources.
It's a bit old now, but I had a great learning experience with The PHP Anthology. If you check it out, please remember that it was published about 5 years ago.
A quick 'net search reveals there's a new one on the market as well, but I don't have experience with it.
Some free PHP5 e-books.
Practical PHP Programming
PHP 5 Objects, Patterns, and Practice
sounds nice
I strongly agree with #stalepretzel -- the w3schools and php.net sites are both incredibly rich resources for both getting you started and keeping you going.
For video tutorials (screencasts), you really can't beat "In the Woods - Diving into PHP" -- The first video is here: http://blog.themeforest.net/screencasts/diving-into-php-video-series/
Handy dandy quick ref here: http://www.addedbytes.com/cheat-sheets/php-cheat-sheet/
When/if you get stuck on a specific problem you can always come back here to SO.
Nicholas
What is your opinion about w3schools ? I recommend this website. This is suitable for beginners and advanced level too.
Also i would like to refer official PHP website and You Tube(Search Video related to PHP)