Prelude API
    Preparing search index...

    Function distanceAt

    • Calculate the similarity score between a query and source lines at a given source line index.

      Parameters

      • sourceLines: string[]

        The lines of the text.

      • at: number

        The line index at which to start calculating the similarity score.

      • queryLines: string[]

        The lines of the query.

      • distanceOf: (source: string, target: string) => number = levenshtein
          • (source: string, target: string): number
          • Parameters

            • source: string
            • target: string

            Returns number

            The Levenshtein distance between two strings.

      Returns number

      Elementwise sum of similarity scores for query lines against source lines starting at given index.