Titles: Add German smallwords to improve capitalization
This commit is contained in:
parent
e923391427
commit
a5f8e6149f
2 changed files with 74 additions and 20 deletions
|
@ -49,6 +49,10 @@ func TestTitle(t *testing.T) {
|
|||
t.Run("BrowseYourLife", func(t *testing.T) {
|
||||
assert.Equal(t, "Browse Your Life in Pictures", Title("Browse your life in pictures"))
|
||||
})
|
||||
t.Run("German", func(t *testing.T) {
|
||||
assert.Equal(t, "Die Burg von oben gesehen.", Title("die burg von oben gesehen."))
|
||||
assert.Equal(t, "Die Katze ist auf dem Dach für viele nicht sichtbar!", Title("die katze ist auf dem dach für viele nicht sichtbar!"))
|
||||
})
|
||||
t.Run("PhotoLover", func(t *testing.T) {
|
||||
assert.Equal(t, "Photo-Lover", Title("photo-lover"))
|
||||
})
|
||||
|
|
|
@ -1,24 +1,74 @@
|
|||
package txt
|
||||
|
||||
var SmallWords = map[string]bool{
|
||||
"a": true,
|
||||
"an": true,
|
||||
"as": true,
|
||||
"at": true,
|
||||
"by": true,
|
||||
"in": true,
|
||||
"of": true,
|
||||
"on": true,
|
||||
"or": true,
|
||||
"up": true,
|
||||
"to": true,
|
||||
"and": true,
|
||||
"but": true,
|
||||
"for": true,
|
||||
"nor": true,
|
||||
"the": true,
|
||||
"from": true,
|
||||
"with": true,
|
||||
"und": true,
|
||||
"des": true,
|
||||
"a": true, // English ↓
|
||||
"an": true,
|
||||
"as": true,
|
||||
"at": true,
|
||||
"by": true,
|
||||
"in": true,
|
||||
"of": true,
|
||||
"on": true,
|
||||
"or": true,
|
||||
"up": true,
|
||||
"to": true,
|
||||
"and": true,
|
||||
"but": true,
|
||||
"for": true,
|
||||
"nor": true,
|
||||
"the": true,
|
||||
"from": true,
|
||||
"with": true,
|
||||
"zu": true, // German ↓
|
||||
"ab": true,
|
||||
"um": true,
|
||||
"bei": true,
|
||||
"aus": true,
|
||||
"das": true,
|
||||
"der": true,
|
||||
"dem": true,
|
||||
"mir": true,
|
||||
"auf": true,
|
||||
"ist": true,
|
||||
"und": true,
|
||||
"uns": true,
|
||||
"des": true,
|
||||
"von": true,
|
||||
"für": true,
|
||||
"ein": true,
|
||||
"eine": true,
|
||||
"sind": true,
|
||||
"sein": true,
|
||||
"auch": true,
|
||||
"mich": true,
|
||||
"oben": true,
|
||||
"nach": true,
|
||||
"über": true,
|
||||
"ohne": true,
|
||||
"eines": true,
|
||||
"nicht": true,
|
||||
"davor": true,
|
||||
"unter": true,
|
||||
"neben": true,
|
||||
"gegen": true,
|
||||
"viele": true,
|
||||
"trotz": true,
|
||||
"warst": true,
|
||||
"waren": true,
|
||||
"sehen": true,
|
||||
"später": true,
|
||||
"werden": true,
|
||||
"werdet": true,
|
||||
"dessen": true,
|
||||
"gesehen": true,
|
||||
"abseits": true,
|
||||
"entlang": true,
|
||||
"sichtbar": true,
|
||||
"entgegen": true,
|
||||
"zwischen": true,
|
||||
"oberhalb": true,
|
||||
"unterhalb": true,
|
||||
"bezüglich": true,
|
||||
"unsichtbar": true,
|
||||
"einschließlich": true,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue