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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.