<commit_before>package mvc

import (
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"unicode"

	"github.com/kataras/iris/core/router"
	"github.com/kataras/iris/macro"
)

const (
	tokenBy       = "By"
	tokenWildcard = "Wildcard" // "ByWildcard".
)

// word lexer, not characters.
type methodLexer struct {
	words []string
	cur   int
}

func newMethodLexer(s string) *methodLexer {
	l := new(methodLexer)
	l.reset(s)
	return l
}

func (l *methodLexer) reset(s string) {
	l.cur = -1
	var words []string
	if s != "" {
		end := len(s)
		start := -1

		for i, n := 0, end; i < n; i++ {
			c := rune(s[i])
			if unicode.IsUpper(c) {
				// it doesn't count the last uppercase
				if start != -1 {
					end = i
					words = append(words, s[start:end])
				}
				start = i
				continue
			}
			end = i + 1
		}

		if end > 0 && len(s) >= end {
			words = append(words, s[start:end])
		}
	}

	l.words = words
}

func (l *methodLexer) next() (w string) {
	cur := l.cur + 1

	if w = l.peek(cur); w != "" {
		l.cur++
	}

	return
}

func (l *methodLexer) skip() {
	if cur := l.cur + 1; cur < len(l.words) {
		l.cur = cur
	} else {
		l.cur = len(l.words) - 1
	}
}

func (l *methodLexer) peek(idx int) string {
	if idx < len(l.words) {
		return l.words[idx]<commit_msg>Fix bug:about the MVC package route binding<commit_after>package mvc

import (
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"unicode"

	"github.com/kataras/iris/core/router"
	"github.com/kataras/iris/macro"
)

const (
	tokenBy       = "By"
	tokenWildcard = "Wildcard" // "ByWildcard".
)

// word lexer, not characters.
type methodLexer struct {
	words []string
	cur   int
}

func newMethodLexer(s string) *methodLexer {
	l := new(methodLexer)
	l.reset(s)
	return l
}

func (l *methodLexer) reset(s string) {
	l.cur = -1
	var words []string
	if s != "" {
		end := len(s)
		start := -1

		for i, n := 0, end; i < n; i++ {
			c := rune(s[i])
			if unicode.IsUpper(c) {
				// it doesn't count the last uppercase
				if start != -1 {
					end = i
					words = append(words, s[start:end])
				}
				start = i
				continue
			}
			end = i + 1
		}

		if end > 0 && len(s) >= end {
			words = append(words, s[start:])
		}
	}

	l.words = words
}

func (l *methodLexer) next() (w string) {
	cur := l.cur + 1

	if w = l.peek(cur); w != "" {
		l.cur++
	}

	return
}

func (l *methodLexer) skip() {
	if cur := l.cur + 1; cur < len(l.words) {
		l.cur = cur
	} else {
		l.cur = len(l.words) - 1
	}
}

func (l *methodLexer) peek(idx int) string {
	if idx < len(l.words) {
		return l.words[idx]
{'fraction_non_alphanumeric': 0.17053958251280033, 'fraction_numerical': 0.0070894052776683735, 'mean_word_length': 2.5425383542538356, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '1662385', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1078, 'n_words': 279}