0.1.16 • Published 5 years ago
car-registration-distance v0.1.16
ocr-post-process
use levenshtein-distance to correct spelling of some data in result
npm install car-registration-distanceimport { improveResult } from 'car-registration-distance';
const a = {
    result: {
        vehicle_license_province: 'กรุงเทพมคร',
        vehicle_color: 'นำเงิน',
        vehicle_brand: 'TO YOTA',
        vehicle_engine_brand: 'TOYO',
        vehicle_fuel_type: 'เบนซ',
    },
};
const b = improveResult(r1);
console.log(b);
// expect b as below
// {
//     result: {
//         vehicle_license_province: 'กรุงเทพมหานคร',
//         vehicle_color: 'น้ำเงิน',
//         vehicle_brand: 'TOYOTA',
//         vehicle_engine_brand: 'TOYOTA',
//         vehicle_fuel_type: 'เบนซิน',
//     },
// };