Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.fromString = function fromString (data, version) {
var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
var nodes = buildNodes(segs);
var graph = buildGraph(nodes, version);
var path = dijkstra.find_path(graph.map, 'start', 'end');
var optimizedSegs = [];
for (var i = 1; i < path.length - 1; i++) {
optimizedSegs.push(graph.table[path[i]].node);
}
return exports.fromArray(mergeSegments(optimizedSegs))
};
exports.fromString = function fromString (data, version) {
var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())
var nodes = buildNodes(segs)
var graph = buildGraph(nodes, version)
var path = dijkstra.find_path(graph.map, 'start', 'end')
var optimizedSegs = []
for (var i = 1; i < path.length - 1; i++) {
optimizedSegs.push(graph.table[path[i]].node)
}
return exports.fromArray(mergeSegments(optimizedSegs))
}
exports.fromString = function fromString (data, version) {
var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
var nodes = buildNodes(segs);
var graph = buildGraph(nodes, version);
var path = dijkstra.find_path(graph.map, 'start', 'end');
var optimizedSegs = [];
for (var i = 1; i < path.length - 1; i++) {
optimizedSegs.push(graph.table[path[i]].node);
}
return exports.fromArray(mergeSegments(optimizedSegs))
};
exports.fromString = function fromString (data, version) {
var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
var nodes = buildNodes(segs);
var graph = buildGraph(nodes, version);
var path = dijkstra.find_path(graph.map, 'start', 'end');
var optimizedSegs = [];
for (var i = 1; i < path.length - 1; i++) {
optimizedSegs.push(graph.table[path[i]].node);
}
return exports.fromArray(mergeSegments(optimizedSegs))
};