Skip to content
This repository has been archived by the owner on May 8, 2019. It is now read-only.

Commit

Permalink
Fixed a few coding errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
garycourt committed Jun 15, 2011
1 parent 53c0c93 commit e03dbab
Show file tree
Hide file tree
Showing 10 changed files with 429 additions and 408 deletions.
11 changes: 8 additions & 3 deletions Jakefile
Expand Up @@ -7,8 +7,9 @@ var srcDir = './src/';
var codeDirs = [srcDir, srcDir + 'util/', srcDir + 'analysis/', srcDir + 'analysis/porter/', srcDir + 'analysis/standard/', srcDir + 'index/', srcDir + 'search/', srcDir + 'parser/'];
var codeOutput = 'json-search.js';
var interfaceDirs = [srcDir + 'interface/'];
var interfaceOutput = 'externs.js';
var interfaceOutput = 'interface.js';
var compressOutput = 'json-search.min.js';
var externs = 'externs.js';

/**
* Default Task
Expand Down Expand Up @@ -112,16 +113,20 @@ task('compress', function () {
var args = [
'-jar',
'./lib/closure/compiler.jar',
'--js',
codeOutput,
'--externs',
externs,
'--externs',
interfaceOutput,
'--js',
codeOutput,
'--js_output_file',
compressOutput,
'--compilation_level',
'SIMPLE_OPTIMIZATIONS',
'--language_in',
'ECMASCRIPT3',
//'--warning_level',
//'VERBOSE',
'--jscomp_warning',
'accessControls',
'--jscomp_warning',
Expand Down
317 changes: 5 additions & 312 deletions externs.js
@@ -1,319 +1,12 @@
/**
* @interface
* @type {Object}
*/

function Analyzer() {};
var exports;

/**
* @param {string} value
* @param {FieldName} [field]
* @return {Array.<Token>}
* @param {string} module
* @return {Object}
*/

Analyzer.prototype.parse = function (value, field) {};


/**
* @interface
*/

function Index() {};

/**
* @param {Object} doc
* @param {DocumentID} id
* @param {function(PossibleError)} [callback]
*/

Index.prototype.indexDocument = function (doc, id, callback) {};

/**
* @param {Object} doc
* @param {DocumentID|null} [id]
* @param {function(PossibleError)} [callback]
*/

Index.prototype.addDocument = function (doc, id, callback) {};

/**
* @param {DocumentID} id
* @param {function(PossibleError, (Object|undefined))} callback
*/

Index.prototype.getDocument = function (id, callback) {};

/**
* @param {Indexer} indexer
* @param {function(PossibleError)} [callback]
*/

Index.prototype.setIndexer = function (indexer, callback) {};

/**
* @param {function(PossibleError, Indexer)} callback
*/

Index.prototype.getIndexer = function (callback) {};

/**
* @param {FieldName} field
* @param {Term} term
* @return {Stream}
*/

Index.prototype.getTermVectors = function (field, term) {};

/**
* @param {FieldName} field
* @param {Term} startTerm
* @param {Term} endTerm
* @param {boolean} excludeStart
* @param {boolean} excludeEnd
* @param {function(PossibleError, Array.<string>)} [callback]
*/

Index.prototype.getTermRange = function (field, startTerm, endTerm, excludeStart, excludeEnd, callback) {

};

/**
* @interface
* @extends {Analyzer}
*/

function Indexer() {};

/**
* @param {string} value
* @param {FieldName} [field]
* @return {Array.<Token>}
*/

Indexer.prototype.parse = function (value, field) {};

/**
* @param {*} doc
* @param {DocumentID} id
* @return {Array.<TermVector>}
*/

Indexer.prototype.index = function (doc, id) {};

/**
* @return {string}
*/

Indexer.prototype.toSource = function () {};

/**
* @interface
*/

function Query() {};

/**
* @type {number}
*/

Query.prototype.boost;

/**
* @param {Similarity} similarity
* @param {Index} index
* @return {Stream}
*/

Query.prototype.score = function (similarity, index) {};

/**
* @return {Array.<TermVector>}
*/

Query.prototype.extractTerms = function () {};

/**
* @return {Query}
*/

Query.prototype.rewrite = function () {};

/**
* @interface
*/

function Similarity() {};

/**
* @param {TermVector} termVec
* @return {number}
*/

Similarity.prototype.norm = function (termVec) {};

/**
* @param {DocumentTerms} doc
* @return {number}
*/

Similarity.prototype.queryNorm = function (doc) {};

/**
* @param {TermVector} termVec
* @return {number}
*/

Similarity.prototype.tf = function (termVec) {};

/**
* @param {number} distance
* @return {number}
*/

Similarity.prototype.sloppyFreq = function (distance) {};

/**
* @param {TermVector} termVec
* @return {number}
*/

Similarity.prototype.idf = function (termVec) {};

/**
* @param {number} overlap
* @param {number} maxOverlap
* @return {number}
*/

Similarity.prototype.coord = function (overlap, maxOverlap) {};

/**
* @interface
*/

function TermVector() {};

/**
* @type {Term}
*/

TermVector.prototype.term;

/**
* @type {number|undefined}
*/

TermVector.prototype.termFrequency;

/**
* @type {Array.<number>|undefined}
*/

TermVector.prototype.termPositions;

/**
* @type {Array.<number>|undefined}
*/

TermVector.prototype.termStartOffsets;

/**
* @type {Array.<number>|undefined}
*/

TermVector.prototype.termEndOffsets;

/**
* @type {FieldName}
*/

TermVector.prototype.field;

/**
* @type {number|undefined}
*/

TermVector.prototype.fieldBoost;

/**
* @type {number|undefined}
*/

TermVector.prototype.totalFieldTokens;

/**
* @type {number|undefined}
*/

TermVector.prototype.documentBoost;

/**
* @type {DocumentID}
*/

TermVector.prototype.documentID;

/**
* @type {number|undefined}
*/

TermVector.prototype.documentFrequency;

/**
* @type {number|undefined}
*/

TermVector.prototype.totalDocuments;

/**
* @constructor
*/

function Token() {};

/**
* @type {string|undefined}
*/

Token.prototype.value;

/**
* @type {number}
*/

Token.prototype.startOffset;

/**
* @type {number}
*/

Token.prototype.endOffset;

/**
* @type {number}
*/

Token.prototype.positionIncrement;

/**
* @typedef {(Error|string|number|boolean|null|undefined)}
*/

var PossibleError;

/**
* @typedef {(string|number)}
*/

var DocumentID;

/**
* @typedef {(string|null)}
*/

var FieldName;

/**
* @typedef {(string|number|boolean|null)}
*/

var Term;
function require(module) {};

0 comments on commit e03dbab

Please sign in to comment.