Jump to content

detect ascii art


katerina

Recommended Posts

Hi all,

I found an algorithm that detects ascii art in a site.

I would like to make a function with parameter $url which implementates this algorithm.

 

The algorithm is The following is the summary of ASCII art detection rules:

 

  1. Enclosed by < XMP> or < PRE> elements.

  2. One or more occurrences of 4 or more consecutive use of same characters. (characters, or blanks)

          * A. One or more occurrences of 4 or more same characters consecutively.

          * B. When ASCII art does not have 4 consecutive letters, it can be identified by occurrences of 4 or more blank spaces. Sample 'A' with 4 or more spaces. Sample 'B' with 4 or more spaces.

  3. Generally displayed using more than 10 lines.

          * A. When greater than 10 lines are used, any ASCII character is used (irrelevant). Sample with more than 10 lines.

          * B. When less than 10 lines are used, use of non-alphabetic, non-numeric ASCII characters outweigh the use of alphabetic, numeric ASCII characters. - 4 lines for a sleeping kitten ASCII art - 6 lines for heading using ASCII art

Link to comment
https://forums.phpfreaks.com/topic/127011-detect-ascii-art/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.