<commit_before>package main

import (
	"fmt"
	"github.com/codmajik/simplerouter"
	"net/http"
)

func handleAnyOtherRequest(ctx *simplerouter.RoutedContext) (interface{}, error) {
	return fmt.Sprintf("don't think you want '%s'", ctx.Path), nil
}
func handleTwoStory(ctx *simplerouter.RoutedContext) (interface{}, error) {
	return "TWO_STORY_BUILDING", nil
}

func handleOneStory(ctx *simplerouter.RoutedContext) (interface{}, error) {
	return "ONE_STORY_BUILDING", nil
}

func handleNoBuilding(ctx *simplerouter.RoutedContext) (interface{}, error) {
	return "LIST_ALL_BUILDING", nil
}

func main() {
	router := simplerouter.NewRouter()

	router.SimpleRoute("building").HandlerFunc(handleNoBuilding)
	router.SimpleRoute("building.onestory").HandlerFunc(handleOneStory)

	route := router.PrefixRoute("building.")
	route.PrefixSubRoute("onestory.").HandlerFunc(handleAnyOtherRequest)
	route.SimpleSubRoute("twostory").HandlerFunc(handleTwoStory)

	http.HandleFunc("/", func(rw http.ResponseWriter, req *http.Request) {
		qpath := req.URL.Query().Get("q")
		result, err := router.ExecPath(qpath)
		if err != nil {
			rw.Write([]byte("Path Not Found: " + err.Error()))
			return
		}

		rw.Write([]byte(result.(string)))
	})

	fmt.Println("Listening for http request on :9091")
	fmt.Println(http.ListenAndServe(":9091", nil))
}
<commit_msg>fix package rename issue<commit_after>package main

import (
	"fmt"
	sr "github.com/codmajik/servicerouter"
	"net/http"
)

func handleAnyOtherRequest(ctx *sr.RoutedContext) (interface{}, error) {
	return fmt.Sprintf("don't think you want '%s'", ctx.Path), nil
}
func handleTwoStory(ctx *sr.RoutedContext) (interface{}, error) {
	return "TWO_STORY_BUILDING", nil
}

func handleOneStory(ctx *sr.RoutedContext) (interface{}, error) {
	return "ONE_STORY_BUILDING", nil
}

func handleNoBuilding(ctx *sr.RoutedContext) (interface{}, error) {
	return "LIST_ALL_BUILDING", nil
}

func main() {
	router := sr.NewRouter()

	router.SimpleRoute("building").HandlerFunc(handleNoBuilding)
	router.SimpleRoute("building.onestory").HandlerFunc(handleOneStory)

	route := router.PrefixRoute("building.")
	route.PrefixSubRoute("onestory.").HandlerFunc(handleAnyOtherRequest)
	route.SimpleSubRoute("twostory").HandlerFunc(handleTwoStory)

	http.HandleFunc("/", func(rw http.ResponseWriter, req *http.Request) {
		qpath := req.URL.Query().Get("q")
		result, err := router.ExecPath(qpath, req)
		if err != nil {
			rw.Write([]byte("Path Not Found: " + err.Error()))
			return
		}

		rw.Write([]byte(result.(string)))
	})

	fmt.Println("Listening for http request on :9091")
	fmt.Println(http.ListenAndServe(":9091", nil))
}

{'fraction_non_alphanumeric': 0.15743550834597875, 'fraction_numerical': 0.006069802731411229, 'mean_word_length': 6.050802139037433, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3068640', 'n_tokens_mistral': 946, 'n_tokens_neox': 885, 'n_words': 165}