[sosi2osm] 17/30: Move lowercase scripts to the lib file
Ruben Undheim
rubund-guest at moszumanska.debian.org
Sat Oct 4 13:07:55 UTC 2014
This is an automated email from the git hooks/post-receive script.
rubund-guest pushed a commit to branch upstream
in repository sosi2osm.
commit 6501e56dbdf12b028b0dcf56183759cca29debf8
Author: Knut Karevoll <gnonthgol at gmail.com>
Date: Fri Oct 11 23:21:40 2013 +0200
Move lowercase scripts to the lib file
---
lua/adresser.lua | 20 --------------------
lua/sosi2osm.lua | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/lua/adresser.lua b/lua/adresser.lua
index 8ed62ee..e8e55bd 100644
--- a/lua/adresser.lua
+++ b/lua/adresser.lua
@@ -1,23 +1,3 @@
--- Lower with q&d support for norwegian letters
-function norwegian_lower(text)
- text = string.lower(text)
- text = string.gsub(text, "Æ", "æ")
- text = string.gsub(text, "Ø", "ø")
- text = string.gsub(text, "Å", "å")
- return text
-end
-
-function initcase(text)
- text = string.gsub(text, "(([^%s-][\128-\191]*)([^%s-]*))", function (word,initial,rest)
- if word == "I" or word == "PÅ" then
- return norwegian_lower(word)
- else
- return initial .. norwegian_lower(rest)
- end
- end)
-
- return text
-end
out = {}
diff --git a/lua/sosi2osm.lua b/lua/sosi2osm.lua
index 984ebc8..b18695f 100644
--- a/lua/sosi2osm.lua
+++ b/lua/sosi2osm.lua
@@ -28,3 +28,25 @@ function tokens(state, i)
end
return i, indent, tokens
end
+
+-- Lower with q&d support for norwegian letters
+function norwegian_lower(text)
+ text = string.lower(text)
+ text = string.gsub(text, "Æ", "æ")
+ text = string.gsub(text, "Ø", "ø")
+ text = string.gsub(text, "Å", "å")
+ return text
+end
+
+function initcase(text)
+ text = string.gsub(text, "(([^%s-][\128-\191]*)([^%s-]*))", function (word,initial,rest)
+ if word == "I" or word == "PÅ" then
+ return norwegian_lower(word)
+ else
+ return initial .. norwegian_lower(rest)
+ end
+ end)
+
+ return text
+end
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/sosi2osm.git
More information about the Pkg-grass-devel
mailing list