js/match/inputFilter.js
function extractCategoryMap(oSentence) {
    var res = {};
    debuglog(debuglog.enabled ? ('extractCategoryMap ' + JSON.stringify(oSentence)) : '-');
    oSentence.forEach(function (oWord, iIndex) {
        if (oWord.category === IFMatch.CAT_CATEGORY) {
            res[oWord.matchedString] = res[oWord.matchedString] || [];
            res[oWord.matchedString].push({ pos: iIndex });
        }
    });
    utils.deepFreeze(res);
    return res;
}
function extractCategoryMap(oSentence) {
    var res = {};
    debuglog(debuglog.enabled ? ('extractCategoryMap ' + JSON.stringify(oSentence)) : '-');
    oSentence.forEach(function (oWord, iIndex) {
        if (oWord.category === IFMatch.CAT_CATEGORY) {
            res[oWord.matchedString] = res[oWord.matchedString] || [];
            res[oWord.matchedString].push({ pos: iIndex });
        }
    });
    utils.deepFreeze(res);
    return res;
}
function extractCategoryMap ( oSentence ) { var res = { } ; debuglog ( debuglog . enabled ? ( 'extractCategoryMap ' + JSON . stringify ( oSentence ) ) : '-' ) ; oSentence . forEach ( function ( oWord , iIndex ) { if ( oWord . category === IFMatch . CAT_CATEGORY ) { res [ oWord . matchedString ] = res [ oWord . matchedString ] || [ ] ; res [ oWord . matchedString ] . push ( { pos : iIndex } ) ; } } ) ; utils . deepFreeze ( res ) ; return res ; }
Given a sentence, extact categories
Given a sentence extact categories