-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTesting.m
15 lines (13 loc) · 965 Bytes
/
Testing.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% Define the Braille alphabet binary code map
BRAILLE_ALPHABET = containers.Map({'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}, ...
{'?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '??', '??', '??', '??', '??', '??', '??', '??', '??', '??'});
% Test the string2braille function
inputString = 'imageprocessing'; % Define an input string
brailleCode = string2braille(inputString, BRAILLE_ALPHABET); % Encode the string
disp('Encoded Braille Code:');
disp(brailleCode); % Display the encoded Braille code
% Test the braille2string function
brailleCode = '?????????';
decodedString = braille2string(brailleCode, BRAILLE_ALPHABET); % Decode the Braille code
disp('Decoded String:');
disp(decodedString); % Display the decoded string