Packages

  • package root
    Definition Classes
    root
  • package ch
    Definition Classes
    root
  • package usi
    Definition Classes
    ch
  • package inf
    Definition Classes
    usi
  • package reveal
    Definition Classes
    inf
  • package parsing
    Definition Classes
    reveal
  • package units

    Provides classes representing information units (structured and textual units) and meta information (like tf vectors and type mentions).

    Provides classes representing information units (structured and textual units) and meta information (like tf vectors and type mentions).

    Overview

    Information units (implementing the trait InformationUnit) represent paragraphs in a given document, which can be narrative text (NaturalLanguageTaggedUnit) or structured fragments (CodeTaggedUnit). Each information unit exports a set of meta-information (implementing the MetaInformation trait), which are ready made semantic data for simple analyses. This version of StORMeD provides the following meta-information:

    In the case a meta information is not provided for a unit, a AbsentMetaInformation object can be also provided.

    Tutorial

    Suppose you want to get all the types mentioned in a question. First, you retrieve all its information units:

    scala> val questionUnits = question.units
    questionUnits: Seq[ch.usi.inf.reveal.parsing.units.InformationUnit] = ...

    Instead of using the visitor to on all the HASTs, you can exploit the ready made data provided by the meta information. For example, to get all the meta information for units, you can use flatMap:

    scala> import ch.usi.inf.reveal.parsing.units._
    import ch.usi.inf.reveal.parsing.units._
    
    scala> val questionMetaInfos = questionUnits.flatMap { _.metaInformation }
    questionMetaInfos: Seq[ch.usi.inf.reveal.parsing.units.MetaInformation] = List(...)

    You need now to filter to get only the CodeTypesMetaInformation, and then you can get, for example, the mentioned qualified Types:

    scala> val codeTypesMetaInfos = questionMetaInfos.filter { _.isInstanceOf[CodeTypesMetaInformation] }.asInstanceOf[Seq[CodeTypesMetaInformation]]
    codeTypesMetaInfos: Seq[ch.usi.inf.reveal.parsing.units.CodeTypesMetaInformation] = List(...)
    
    scala> val types = codeTypesMetaInfos.flatMap { _.qualifiedTypes }.distinct
    types: Seq[ch.usi.inf.reveal.parsing.model.java.ReferenceTypeNode] = List(...)
    Definition Classes
    parsing
  • package meta
    Definition Classes
    units
  • package lucene
    Definition Classes
    meta
  • DefaultLuceneAnalyzer
  • LuceneIndex
  • NumericFilter
  • StopWords
  • TermFrequencyInfo
  • Terms2Iterator
c

ch.usi.inf.reveal.parsing.units.meta.lucene

DefaultLuceneAnalyzer

class DefaultLuceneAnalyzer extends StopwordAnalyzerBase

Linear Supertypes
StopwordAnalyzerBase, Analyzer, Closeable, AutoCloseable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultLuceneAnalyzer
  2. StopwordAnalyzerBase
  3. Analyzer
  4. Closeable
  5. AutoCloseable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DefaultLuceneAnalyzer(matchVersion: Version, stopwords: Reader)
  2. new DefaultLuceneAnalyzer(matchVersion: Version)
  3. new DefaultLuceneAnalyzer(matchVersion: Version, stopWords: CharArraySet)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val DEFAULT_MAX_TOKEN_LENGTH: Int
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def attributeFactory(arg0: String): AttributeFactory
    Attributes
    protected[org.apache.lucene.analysis]
    Definition Classes
    Analyzer
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def close(): Unit
    Definition Classes
    Analyzer → Closeable → AutoCloseable
  9. def createComponents(fieldName: String): TokenStreamComponents
    Definition Classes
    DefaultLuceneAnalyzer → Analyzer
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  14. def getOffsetGap(arg0: String): Int
    Definition Classes
    Analyzer
  15. def getPositionIncrementGap(arg0: String): Int
    Definition Classes
    Analyzer
  16. final def getReuseStrategy(): ReuseStrategy
    Definition Classes
    Analyzer
  17. def getStopwordSet(): CharArraySet
    Definition Classes
    StopwordAnalyzerBase
  18. def getVersion(): Version
    Definition Classes
    Analyzer
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  20. def initReader(arg0: String, arg1: Reader): Reader
    Attributes
    protected[org.apache.lucene.analysis]
    Definition Classes
    Analyzer
  21. def initReaderForNormalization(arg0: String, arg1: Reader): Reader
    Attributes
    protected[org.apache.lucene.analysis]
    Definition Classes
    Analyzer
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. val maxTokenLength: Int
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def normalize(arg0: String, arg1: String): BytesRef
    Definition Classes
    Analyzer
  26. def normalize(arg0: String, arg1: TokenStream): TokenStream
    Attributes
    protected[org.apache.lucene.analysis]
    Definition Classes
    Analyzer
  27. final def notify(): Unit
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  29. def setVersion(arg0: Version): Unit
    Definition Classes
    Analyzer
  30. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. final def tokenStream(arg0: String, arg1: String): TokenStream
    Definition Classes
    Analyzer
  33. final def tokenStream(arg0: String, arg1: Reader): TokenStream
    Definition Classes
    Analyzer
  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StopwordAnalyzerBase

Inherited from Analyzer

Inherited from Closeable

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped