home *** CD-ROM | disk | FTP | other *** search
- on makelower c
- set startUpper to charToNum("A")
- set startlower to charToNum("a")
- set n to charToNum(c)
- if n < startlower then
- set n to n - startUpper + startlower
- end if
- return numToChar(n)
- end
-
- on isPunc c
- return getPos([" ", ".", ",", ";", ":", "'", RETURN], c) > 0
- end
-
- on isDigit c
- return getPos(["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"], c) > 0
- end
-
- on isRoman c
- set answer to 0
- repeat with checkagainst = 0 to 25
- if (charToNum(c) = (checkagainst + charToNum("a"))) or (charToNum(c) = (checkagainst + charToNum("A"))) then
- set answer to 1
- exit repeat
- end if
- end repeat
- return answer
- end
-
- on FixLetter c
- global weird
- if isRoman(c) then
- set c to makelower(c)
- else
- set weird to 1
- end if
- return c
- end
-
- on FixName n
- set answer to char 1 of n
- repeat with i = 2 to the number of chars in n
- set answer to answer & FixLetter(char i of n)
- end repeat
- return answer
- end
-
- on FixCastNames first, last
- global weird
- repeat with i = first to last
- set n to the name of cast i
- set weird to 0
- set n to FixName(n)
- if weird then
- put i && n
- next repeat
- end if
- set the name of cast i to n
- end repeat
- end
-
- on CorrectWeirdChar
- set BadList to []
- set FixList to []
- end
-
- on FixWeirdChars
- end
-
- on CheckCast cn
- put "CAST:" && the name of cast cn & RETURN
- set charList to []
- repeat with i = 1 to the number of chars in the text of field cn
- set testChar to char i of the text of field cn
- if not isRoman(testChar) and not isPunc(testChar) and not isDigit(testChar) then
- append(charList, testChar)
- end if
- end repeat
- put charList
- end
-
- on CheckLots
- repeat with i = 331 to 360
- CheckCast(i)
- end repeat
- end
-