Skip to content

Commit 10557d7

Browse files
committed
added synopsis
1 parent 461af49 commit 10557d7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/analysis/text/search/Grammars.rsc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ Redistribution and use in source and binary forms, with or without modification,
1010
1111
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1212
}
13+
@synopsis{Bridges Rascal grammars and parser generation to the Lucene "Analyzer" and "Tokenizer" interfaces.}
14+
@description{
15+
By leveraging the information in ((ParseTree)) instances we can provide, selectively, tokens for any source file that
16+
we have a grammar for:
17+
* ((analyzerFromGrammar)) combines a ((tokenizerFromGrammar)) with a ((lowerCaseFilter)). It makes an entire source file searchable.
18+
* ((identifierAnalyzerFromGrammar)) selects only the identifiers in the source text, ignoring keywords and comments and such.
19+
* ((commentAnalyzerFromGrammar)) focuses on the words in source code comments.
20+
21+
This functionality is based on the ((analysis::text::search::Lucene)) module, and its underlying adapter that bridges Rascal callbacks
22+
to Lucene's search framework.
23+
}
1324
module analysis::text::search::Grammars
1425

1526
extend analysis::text::search::Lucene;

src/analysis/text/search/LuceneAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ private SourceLocationIndexInput(String name, byte[] input, int sliceStart, int
815815

816816
this.input = input;
817817

818-
assert sliceStart <= cursor && cursor < sliceEnd;
818+
// assert sliceStart <= cursor && cursor < sliceEnd;
819819

820820
this.start = sliceStart;
821821
this.cursor = cursor;

0 commit comments

Comments
 (0)