I have a Matlab code base whose comments are written in Swedish. It’s something like this:
% Syntax: result = ocr(DOC, METHOD, fname)
% DOC - bild som ska processas
% METHOD - ann eller knear
% fname - full filename of the net ('ann' method) or the database
% ('knear' method)
% default: ann20.mat resp db4000.mat
function result = ocr(DOC, METHOD, fname)
% Segmentera bilden
disp('Segmenting...');
[ROWB, CH] = segment(DOC, 0.99, 0.99);
% Analysera den
switch lower(METHOD)
case 'ann',
% ladda in neuronnät, inför NET, E, CP
if isempty(fname)
load ./db/ann50.mat;
else
load(fname);
end
Well, Google translate came out to be big rescue for me. Here is the result of the copy-paste into translate box, which is pretty satisfactory.
% Syntax: result = ocr (DOC, METHOD, fname)
% DOC - image to be processed
% METHOD - ann or knear
% Fname - full filename of the net ('ann' method) or the database
% ('Knear' method)
% Default: ann20.mat respectively db4000.mat
function result = ocr (DOC, METHOD, fname)
Segment image%
disp ('Segmenting ...');
[ROWB, CH] = segment (DOC, 0.99, 0.99);
% Analyze the
switch lower (METHOD)
case 'ann'
% Load the neural networks, for NET, E, CP
f isempty (fname)
./db/ann50.mat load;
else
load (fname);
end
- Can I automate this process and how, for a multi-file code base?
- How can I deal with the errors such as conversion of
"% Segmentera bilden"
to"Segment image%"
?