...

Package statischetextsuche

import "github.com/ob-algdatii-ss19/leistungsnachweis-statischetextsuche/web/app/statischetextsuche"
Overview
Index

Overview ▾

Web server providing the UI for uploading text files and highlighting the searched substring

Variables

Algorithm is the instance of suffix tree algorithm.

var Algorithm *algorithm.AlgImpl // nolint

Search contains the current substring searched for.

var Search = "" // nolint

Text contains the uploaded text string.

var Text = "" // nolint

func GetFormattedText

func GetFormattedText(expr string) template.HTML

GetFormattedText returns the text with highlighted substring that was searched for. Uses the suffix tree algorithm to find the substrings. Highlighting is made with special HTML tag.

func OnUserEntersHomePage

func OnUserEntersHomePage(w http.ResponseWriter, r *http.Request)

OnUserEntersHomePage is the endpoint hit when opening the Web-UI via GET. Responds with HTML template for Web-UI.

func OnUserError

func OnUserError(w http.ResponseWriter, r *http.Request)

OnUserError is the endpoint hit when an error occurs.

func OnUserSearch

func OnUserSearch(w http.ResponseWriter, r *http.Request)

OnUserSearch is the endpoint hit when searching for a substring via POST.

func OnUserUploadsFile

func OnUserUploadsFile(w http.ResponseWriter, r *http.Request)

OnUserUploadsFile is the endpoint hit when uploading a text file via POST.

func RunWebserver

func RunWebserver()

RunWebserver runs the web server.

type PageData

type PageData struct {
    Search   string
    ShowText bool
    Text     template.HTML
}