-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1378a88
commit b3ee6b3
Showing
36 changed files
with
474 additions
and
189 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Modules/IntentSpecification2WorkflowGenerator/.idea/.gitignore
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...les/IntentSpecification2WorkflowGenerator/.idea/IntentSpecification2WorkflowGenerator.iml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-7.34 KB
Modules/IntentSpecification2WorkflowGenerator/api/temp_files/knime/Decision Tree 1.knwf
Binary file not shown.
Binary file removed
BIN
-7.33 KB
Modules/IntentSpecification2WorkflowGenerator/api/temp_files/knime/Decision Tree 2.knwf
Binary file not shown.
Binary file removed
BIN
-7.32 KB
Modules/IntentSpecification2WorkflowGenerator/api/temp_files/knime/Decision Tree 3.knwf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
Modules/NextiaBS/src/main/java/edu/upc/essi/dtim/nextiabs/utils/Utils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package edu.upc.essi.dtim.nextiabs.utils; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public class Utils { | ||
public static String reformatName(String tableName) { | ||
// Trim whitespaces at the end and the beginning | ||
tableName = tableName.trim(); | ||
// Remove characters that might case problems | ||
String pattern = "[!@#$%^&*)-+=\\[\\]{}\\\\|;:'\"<>,.?/]"; | ||
tableName = tableName.replaceAll(pattern, ""); | ||
// Pass the string to camel case | ||
tableName = toCamelCase(tableName); | ||
|
||
return tableName; | ||
} | ||
|
||
public static String toCamelCase(String inputString) { | ||
StringBuilder camelCaseString = new StringBuilder(); | ||
String[] words = inputString.split("\\s+|(?<=\\()|(?=\\))"); // Split the input string by whitespace or parenthesis | ||
words = Arrays.stream(words).filter(str -> !Objects.equals(str, "(")).toArray(String[]::new); | ||
words = Arrays.stream(words).map(str -> str.replace("(", "")).toArray(String[]::new); | ||
|
||
for (int i = 0; i < words.length; i++) { | ||
String word = words[i]; | ||
if (i == 0) { | ||
camelCaseString.append(word.toLowerCase()); // Convert the first word to lowercase | ||
} else { | ||
camelCaseString.append(Character.toUpperCase(word.charAt(0))); // Capitalize the first letter | ||
camelCaseString.append(word.substring(1).toLowerCase()); // Convert the rest to lowercase | ||
} | ||
} | ||
|
||
return camelCaseString.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.