by vocikag991 » Mon Nov 22, 2021 12:47 pm
drakinite wrote: ↑Sun Nov 21, 2021 11:03 pm
I believe you can simply add "Lana Del Ray" to the custom string list in the dialog, and it'll work as expected. Make sure you're using a 5.0.2 beta build for the most recent version of Case Checker.
I've tried, but that's not the case. I'm using version 5.0.1.2433 but I don't think it's a stable version issue.
In MM4 I have the following script in the Case.vbs file:
Code: Select all
Function updateCase(s)
Dim currentWord, result, fixed, theChar, lastNonWordChars
Dim forceIndex
Dim i
currentWord = ""
result = ""
lastNonWordChars = ""
For i = 1 to Len(s)
theChar = Mid(s,i,1)
If alphaNum.test(theChar) Then
currentWord = currentWord & theChar
Else
If currentWord <> "" Then
fixed = fixUp(currentWord,lastNonWordChars,theChar)
If Right(fixed,1) = theChar Then 'handle stuff like w/
fixed = Left(fixed,Len(fixed)-1)
lastNonWordChars = ""
Else
lastNonWordChars = theChar
End If
result = result & fixed
currentWord = ""
Else
lastNonWordChars = lastNonWordChars & theChar
End If
result = result & theChar
End If
Next 'i
If Len(currentWord) > 0 Then
result = result & fixUp(currentWord,lastNonWordChars,"")
End If
If Instr(result,"Lana del Rey") Then result=Replace(result,"Lana del Rey", "Lana Del Rey")
If Instr(result,"P!NK") Then result=Replace(result,"P!NK", "P!nk")
updateCase = result
End Function
As you can see, it manages P!nk as well since even if I write it in the forced caps it still converts to P!NK.
In MM5, the function updateCase(s) block is the following:
Code: Select all
function updateCase(s) {
var fixed, theChar;
var forceIndex;
var currentWord = "";
var result = "";
var lastNonWordChars = "";
for (var i = 0; i < s.length; i++) {
theChar = s[i];
if (alphaNum.test(theChar)) {
currentWord = currentWord + theChar;
} else {
if (currentWord !== "") {
fixed = fixUp(currentWord, lastNonWordChars, theChar);
if (fixed.slice(-1) === theChar) { // handle stuff like w/
fixed = fixed.substring(0, fixed.length - 1);
lastNonWordChars = "";
} else {
lastNonWordChars = theChar;
}
result = result + fixed;
currentWord = "";
} else {
lastNonWordChars = lastNonWordChars + theChar;
}
result = result + theChar;
}
};
if (currentWord.length > 0) {
result = result + fixUp(currentWord, lastNonWordChars, "");
}
return result;
};
I'm pretty sure this should be possible as well, but I don't know the correct syntax to add the exceptions..
[quote=drakinite post_id=490603 time=1637553798 user_id=107828]
I believe you can simply add "Lana Del Ray" to the custom string list in the dialog, and it'll work as expected. Make sure you're using a 5.0.2 beta build for the most recent version of Case Checker.
[/quote]
I've tried, but that's not the case. I'm using version 5.0.1.2433 but I don't think it's a stable version issue.
In MM4 I have the following script in the Case.vbs file:
[code]Function updateCase(s)
Dim currentWord, result, fixed, theChar, lastNonWordChars
Dim forceIndex
Dim i
currentWord = ""
result = ""
lastNonWordChars = ""
For i = 1 to Len(s)
theChar = Mid(s,i,1)
If alphaNum.test(theChar) Then
currentWord = currentWord & theChar
Else
If currentWord <> "" Then
fixed = fixUp(currentWord,lastNonWordChars,theChar)
If Right(fixed,1) = theChar Then 'handle stuff like w/
fixed = Left(fixed,Len(fixed)-1)
lastNonWordChars = ""
Else
lastNonWordChars = theChar
End If
result = result & fixed
currentWord = ""
Else
lastNonWordChars = lastNonWordChars & theChar
End If
result = result & theChar
End If
Next 'i
If Len(currentWord) > 0 Then
result = result & fixUp(currentWord,lastNonWordChars,"")
End If
If Instr(result,"Lana del Rey") Then result=Replace(result,"Lana del Rey", "Lana Del Rey")
If Instr(result,"P!NK") Then result=Replace(result,"P!NK", "P!nk")
updateCase = result
End Function[/code]
As you can see, it manages P!nk as well since even if I write it in the forced caps it still converts to P!NK.
In MM5, the function updateCase(s) block is the following:
[code]function updateCase(s) {
var fixed, theChar;
var forceIndex;
var currentWord = "";
var result = "";
var lastNonWordChars = "";
for (var i = 0; i < s.length; i++) {
theChar = s[i];
if (alphaNum.test(theChar)) {
currentWord = currentWord + theChar;
} else {
if (currentWord !== "") {
fixed = fixUp(currentWord, lastNonWordChars, theChar);
if (fixed.slice(-1) === theChar) { // handle stuff like w/
fixed = fixed.substring(0, fixed.length - 1);
lastNonWordChars = "";
} else {
lastNonWordChars = theChar;
}
result = result + fixed;
currentWord = "";
} else {
lastNonWordChars = lastNonWordChars + theChar;
}
result = result + theChar;
}
};
if (currentWord.length > 0) {
result = result + fixUp(currentWord, lastNonWordChars, "");
}
return result;
};[/code]
I'm pretty sure this should be possible as well, but I don't know the correct syntax to add the exceptions..