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 similarity
    Definition Classes
    units
  • ASTNodeCollectorVisitor
  • InformationUnitSimilarity
  • MetaComparable
  • MetaInformationFeatures
  • MetaInformationSimilarities
  • NaturalLanguageTaggedUnitFactory
  • NlpUtils
  • NonSequenceVisitor
  • SimilarityParameters
o

ch.usi.inf.reveal.parsing.units.similarity

ASTNodeCollectorVisitor

object ASTNodeCollectorVisitor extends ElementAccumulatorVisitor[HASTNode]

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ASTNodeCollectorVisitor
  2. ElementAccumulatorVisitor
  3. ArtifactVisitor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit class ComposableVisitor [T <: HList] extends AnyRef
    Definition Classes
    ArtifactVisitor
  2. type ExtractorType = PartialFunction[Visitable, GenTraversableOnce[HASTNode]]

    The extractor type, that is, a partial function from a visitable element and a collection of elements.

    The extractor type, that is, a partial function from a visitable element and a collection of elements.

    Definition Classes
    ElementAccumulatorVisitor
  3. type Visitable = Any
    Definition Classes
    ArtifactVisitor
  4. type Visitor[Result] = (Result, Visitable) ⇒ Result
    Definition Classes
    ArtifactVisitor
  5. type VisitorChildrenExtractor = PartialFunction[Visitable, Traversable[Any]]
    Definition Classes
    ArtifactVisitor
  6. type VisitorFilter = (Visitable) ⇒ Boolean
    Definition Classes
    ArtifactVisitor

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 VNil: Visitor[HNil]
    Definition Classes
    ArtifactVisitor
  5. def apply[T <: TraversableLike[HASTNode, T]]()(implicit bf: CanBuildFrom[T, HASTNode, T]): Visitor[T]
    Definition Classes
    ElementAccumulatorVisitor
  6. def apply[T <: TraversableLike[HASTNode, T]](filter: (Visitable) ⇒ Boolean)(implicit bf: CanBuildFrom[T, HASTNode, T]): Visitor[T]
    Definition Classes
    ElementAccumulatorVisitor
  7. def apply[T](filter: VisitorFilter, visitFunction: Visitor[T]): Visitor[T]
    Definition Classes
    ArtifactVisitor
  8. def applyWithChildrenExtractor[T](childrenExtractor: VisitorChildrenExtractor, visitFunction: Visitor[T]): Visitor[T]
    Definition Classes
    ArtifactVisitor
  9. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  10. def children(element: Any): Traversable[Any]
    Definition Classes
    ArtifactVisitor
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def elementAccumulator[T <: TraversableLike[HASTNode, T]](elements: T, element: Visitable)(implicit bf: CanBuildFrom[T, HASTNode, T]): T
    Definition Classes
    ElementAccumulatorVisitor
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. val everything: (Visitable) ⇒ Boolean
    Definition Classes
    ArtifactVisitor
  16. def extractor: PartialFunction[Visitable, GenTraversableOnce[HASTNode]]

    The extractor method.

    The extractor method.

    Definition Classes
    ASTNodeCollectorVisitorElementAccumulatorVisitor
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def list(): Visitor[List[HASTNode]]

    Accumulates elements as a list, using no filter.

    Accumulates elements as a list, using no filter.

    Definition Classes
    ElementAccumulatorVisitor
  22. def list(filter: (Visitable) ⇒ Boolean): Visitor[List[HASTNode]]

    Accumulates elements as a list, using a specific filter to determine which elements of which children must be visited.

    Accumulates elements as a list, using a specific filter to determine which elements of which children must be visited.

    Definition Classes
    ElementAccumulatorVisitor
  23. def listWithChildrenExtractor(childrenExtractor: PartialFunction[Visitable, Traversable[Any]]): Visitor[List[HASTNode]]

    Accumulates elements as a list, using a specific extractor to determine which elements of which children must be visited.

    Accumulates elements as a list, using a specific extractor to determine which elements of which children must be visited.

    Definition Classes
    ElementAccumulatorVisitor
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. val nothing: (Visitable) ⇒ Boolean
    Definition Classes
    ArtifactVisitor
  26. final def notify(): Unit
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  28. def seq(): Visitor[Seq[HASTNode]]

    Accumulates elements as a sequence, using no filter.

    Accumulates elements as a sequence, using no filter.

    Definition Classes
    ElementAccumulatorVisitor
  29. def seq(filter: (Visitable) ⇒ Boolean): Visitor[Seq[HASTNode]]

    Accumulates elements as a sequence, using a specific filter to determine which elements of which children must be visited.

    Accumulates elements as a sequence, using a specific filter to determine which elements of which children must be visited.

    Definition Classes
    ElementAccumulatorVisitor
  30. def seqWithChildrenExtractor(childrenExtractor: PartialFunction[Visitable, Traversable[Any]]): Visitor[Seq[HASTNode]]

    Accumulates elements as a sequence, using a specific extractor to determine which elements of which children must be visited.

    Accumulates elements as a sequence, using a specific extractor to determine which elements of which children must be visited.

    Definition Classes
    ElementAccumulatorVisitor
  31. def set(): Visitor[Set[HASTNode]]

    Accumulates elements as a set, using no filter.

    Accumulates elements as a set, using no filter.

    Definition Classes
    ElementAccumulatorVisitor
  32. def set(filter: (Visitable) ⇒ Boolean): Visitor[Set[HASTNode]]

    Accumulates elements as a set, using a specific filter to determine which elements of which children must be visited.

    Accumulates elements as a set, using a specific filter to determine which elements of which children must be visited.

    Definition Classes
    ElementAccumulatorVisitor
  33. def setWithChildrenExtractor(childrenExtractor: PartialFunction[Visitable, Traversable[Any]]): Visitor[Set[HASTNode]]

    Accumulates elements as a set, using a specific extractor to determine which elements of which children must be visited.

    Accumulates elements as a set, using a specific extractor to determine which elements of which children must be visited.

    Definition Classes
    ElementAccumulatorVisitor
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ArtifactVisitor

Inherited from AnyRef

Inherited from Any

Ungrouped