import
java.io.*;
import
java.util.*;
class
GFG {
public
static
boolean
isVowel(String c)
{
return
(c.equals(
"a"
) || c.equals(
"A"
)
|| c.equals(
"e"
) || c.equals(
"E"
)
|| c.equals(
"i"
) || c.equals(
"I"
)
|| c.equals(
"o"
) || c.equals(
"O"
)
|| c.equals(
"u"
) || c.equals(
"U"
));
}
public
static
HashMap<String, Boolean>
VowelSubstrings(String string)
{
String str =
""
;
HashMap<String, Boolean> map =
new
HashMap<>();
for
(
int
i =
0
; i < string.length(); i++) {
String subStr = string.substring(i, (i +
1
));
if
(isVowel(subStr)) {
str += subStr;
}
else
{
if
(!str.isEmpty())
map.putIfAbsent(str,
true
);
str =
""
;
}
}
if
(!str.isEmpty())
map.putIfAbsent(str,
true
);
return
map;
}
public
static
void
generateVowelSubstrings(String string)
{
HashMap<String, Boolean> substringMap
= VowelSubstrings(string);
HashMap<String, Boolean> map =
new
HashMap<>();
for
(String key : substringMap.keySet()) {
for
(
int
i =
0
; i < key.length(); i++) {
for
(
int
j = i +
1
; j <= key.length();
j++) {
map.putIfAbsent(key.substring(i, j),
true
);
}
}
}
for
(String key : map.keySet()) {
System.out.println(key);
}
}
public
static
void
main(String[] args)
{
String str =
"GeeksForGeeks"
;
generateVowelSubstrings(str);
}
}