Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function (inputData, inputDictionary) {
- const dict = new Set(inputDictionary);
- if (inputData.every(d => dict.has(d.text))) {
- inputData.sort((d1, d2) => d1.geometry[0] - d2.geometry[0]);
- return inputData.map(d => d.text).join(' ');
- }
- return "Unreadable message";
- }
- ////////////////////////////////////////////////////////////////////////
- module.exports = function (inputData, inputDictionary) {
- const dict = new Set(inputDictionary);
- inputData.sort((d1, d2) => d1.geometry[0] - d2.geometry[0]);
- if (inputData.every(d => dict.has(d.text))) {
- return inputData.map(d => d.text).join(' ');
- }
- return "Unreadable message";
- }
Advertisement
Add Comment
Please, Sign In to add comment