Match similar vehicles according to algorithm rules

Source: Internet
Author: User

Recognition of license plate error less than 2 digits display entry information higher than 2 digits not displayed
The recognition rule is 1 digits according to the province error and the following digit letter error is 1 bits.
A matching license plate entry can be displayed as long as the combined error rate is <= 2.
That is, the province error is 1 bit + any subsequent 1-bit errors will display matching similar information

For example: Yu a BCDE9 yu a BCDE8 yue a BCDE9 yue B BCDE9 New Energy A truth

 //Get related vehicle information Public StaticList<currentparking> Getcurrentparkingbycode (stringStrplatecode) {List<CurrentParking> inparksimilarlist =NewList<currentparking>(); using(Parkingcontext db=NewParkingcontext ()) {                                               stringSqlstr ="SELECT * from inparking where type=0 and (Plateno!=null OR plateno!= ") Order BY inrecordid Desc"; Objectresult<CurrentParking> Objresult = db. Executestorequery<currentparking>(SQLSTR); if(Objresult! =NULL)                {                    varParklist =Objresult.                    ToList (); //                    //traverse the data loop to take the license plate information to pass the license plate information cycle ratio                     for(inti =0; I < Parklist. Count; i++)                    {                        stringPlateno =Parklist[i].                        Platecode; //The error rate is <= 2 is less than or equal to 2 bits to display the matching license plate entry record                        if(Similarplateno (Plateno, Strplatecode) <=2)                        {                            //values that meet the criteria are saved to the list collectionInparksimilarlist.add (Parklist[i]); }                    }                }            }            returninparksimilarlist; }
        /// <summary>        ///The similarity ratio is based on the acquired license plate number and the online license plate number passed/// </summary>        /// <param name= "" ></param>        /// <param name= "" ></param>        /// <returns></returns>         Public Static intSimilarplateno (stringPlateno,stringStrplatecode) {            intNret =0;  Do {                if(Plateno = =NULL|| Strplatecode = =NULL)                {                     Break; }                if(Plateno. Length! =Strplatecode. Length) { Break; }                 for(inti =0; i < plateno.length; i++)                {                    //Str[i] Indicates whether the characters in the string are similar//The number of similar lengths is calculated by using the Loop-out license plate length and the string passing over the license plate.                    if(Plateno[i] = =Strplatecode[i]) {Nret++; }                }              }             while(false); //circulation of license plate length-Similar length = Error recognition degree            returnPlateno.length-Nret; }

Match similar vehicles according to algorithm rules

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.