├── .gradle ├── 6.9 │ ├── gc.properties │ ├── fileChanges │ │ └── last-build.bin │ ├── fileHashes │ │ ├── fileHashes.bin │ │ └── fileHashes.lock │ └── executionHistory │ │ ├── executionHistory.bin │ │ └── executionHistory.lock ├── 7.4 │ ├── gc.properties │ ├── fileChanges │ │ └── last-build.bin │ ├── dependencies-accessors │ │ ├── gc.properties │ │ └── dependencies-accessors.lock │ ├── checksums │ │ ├── checksums.lock │ │ ├── md5-checksums.bin │ │ └── sha1-checksums.bin │ ├── fileHashes │ │ ├── fileHashes.bin │ │ └── fileHashes.lock │ └── executionHistory │ │ ├── executionHistory.bin │ │ └── executionHistory.lock ├── vcs-1 │ └── gc.properties ├── buildOutputCleanup │ ├── cache.properties │ ├── outputFiles.bin │ └── buildOutputCleanup.lock ├── file-system.probe └── checksums │ ├── checksums.lock │ ├── md5-checksums.bin │ └── sha1-checksums.bin ├── gradle.properties ├── Miscellaneous ├── Revamped Logo.png ├── Resume Ranker Logo.png └── License ├── Output ├── V2 (Kotlin, Swing) │ ├── Demo.gif │ └── JFrame GUI screenshot from a single run with five resumes.png ├── V3 (Kotlin, Compose) │ ├── Demo.gif │ └── Demo fullscreen.gif └── V1 (Java, Swing, old code) │ ├── Jframe GUI and Console Screenshot.png │ └── Jframe GUI and Output Document Screenshot.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── Source ├── Main │ ├── Resources │ │ ├── path-icon.png │ │ ├── folder-icon.png │ │ └── keyword-icon.png │ └── Kotlin │ │ ├── Theme │ │ ├── Colors.kt │ │ └── Theme.kt │ │ ├── UI │ │ ├── WindowMenus.kt │ │ ├── FileDialog.kt │ │ └── MainScreen.kt │ │ ├── Repos │ │ └── Repository.kt │ │ ├── Main.kt │ │ └── Util │ │ └── ResumeScanner.kt └── Former versions │ ├── Kotlin │ ├── main.kt │ ├── GUI.kt │ └── ResumeScanner.kt │ └── Java │ ├── FileFilterer.java │ └── ResumeScanner.java ├── .idea ├── compiler.xml ├── .gitignore ├── misc.xml ├── gradle.xml └── jarRepositories.xml ├── .gitignore ├── settings.gradle.kts ├── Readme.md ├── gradlew.bat └── gradlew /.gradle/6.9/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/7.4/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/6.9/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/7.4/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/7.4/dependencies-accessors/gc.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | kotlin.code.style=official 2 | -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Sat May 28 04:00:32 AEST 2022 2 | gradle.version=7.4 3 | -------------------------------------------------------------------------------- /.gradle/file-system.probe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/file-system.probe -------------------------------------------------------------------------------- /Miscellaneous/Revamped Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Miscellaneous/Revamped Logo.png -------------------------------------------------------------------------------- /.gradle/checksums/checksums.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/checksums/checksums.lock -------------------------------------------------------------------------------- /Output/V2 (Kotlin, Swing)/Demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Output/V2 (Kotlin, Swing)/Demo.gif -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gradle/7.4/checksums/checksums.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/checksums/checksums.lock -------------------------------------------------------------------------------- /.gradle/checksums/md5-checksums.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/checksums/md5-checksums.bin -------------------------------------------------------------------------------- /.gradle/checksums/sha1-checksums.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/checksums/sha1-checksums.bin -------------------------------------------------------------------------------- /Miscellaneous/Resume Ranker Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Miscellaneous/Resume Ranker Logo.png -------------------------------------------------------------------------------- /Output/V3 (Kotlin, Compose)/Demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Output/V3 (Kotlin, Compose)/Demo.gif -------------------------------------------------------------------------------- /Source/Main/Resources/path-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Source/Main/Resources/path-icon.png -------------------------------------------------------------------------------- /.gradle/6.9/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/6.9/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/6.9/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/6.9/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/7.4/checksums/md5-checksums.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/checksums/md5-checksums.bin -------------------------------------------------------------------------------- /.gradle/7.4/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/7.4/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /Source/Main/Resources/folder-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Source/Main/Resources/folder-icon.png -------------------------------------------------------------------------------- /Source/Main/Resources/keyword-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Source/Main/Resources/keyword-icon.png -------------------------------------------------------------------------------- /.gradle/7.4/checksums/sha1-checksums.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/checksums/sha1-checksums.bin -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /.gradle/6.9/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/6.9/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /.gradle/7.4/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /Output/V3 (Kotlin, Compose)/Demo fullscreen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Output/V3 (Kotlin, Compose)/Demo fullscreen.gif -------------------------------------------------------------------------------- /.gradle/6.9/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/6.9/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /.gradle/7.4/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /.gradle/7.4/dependencies-accessors/dependencies-accessors.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock -------------------------------------------------------------------------------- /Output/V1 (Java, Swing, old code)/Jframe GUI and Console Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Output/V1 (Java, Swing, old code)/Jframe GUI and Console Screenshot.png -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Output/V1 (Java, Swing, old code)/Jframe GUI and Output Document Screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Output/V1 (Java, Swing, old code)/Jframe GUI and Output Document Screenshot.png -------------------------------------------------------------------------------- /Output/V2 (Kotlin, Swing)/JFrame GUI screenshot from a single run with five resumes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Anirban166/Resume-Ranker/HEAD/Output/V2 (Kotlin, Swing)/JFrame GUI screenshot from a single run with five resumes.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignorance of these files is, but a blessing: 2 | .DS_Store 3 | /shelf/ 4 | /workspace.xml 5 | # Ignoring editor-based HTTP client requests and local storage stuff: 6 | /httpRequests/ 7 | /dataSources/ 8 | /dataSources.local.xml -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignorance of these files is, but a blessing: 2 | .DS_Store 3 | /shelf/ 4 | /workspace.xml 5 | # Ignoring editor-based HTTP client requests and local storage stuff: 6 | /httpRequests/ 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | gradlePluginPortal() 5 | maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") 6 | } 7 | 8 | } 9 | rootProject.name = "ResumeScannerCompose" 10 | 11 | -------------------------------------------------------------------------------- /Source/Former versions/Kotlin/main.kt: -------------------------------------------------------------------------------- 1 | // Set this to wherever you desire a run's record to be kept at: 2 | const val LOG_DIRECTORY = "./logFilePath" 3 | 4 | fun main() 5 | { 6 | var gui: GUI? = null 7 | 8 | gui = GUI( 9 | { 10 | gui?.let { ResumeScanner(it) } 11 | }) .apply { isVisible = true } 12 | 13 | } -------------------------------------------------------------------------------- /Source/Main/Kotlin/Theme/Colors.kt: -------------------------------------------------------------------------------- 1 | package theme 2 | import androidx.compose.ui.graphics.Color 3 | 4 | val Teal200 = Color(0xFF03DAC5) 5 | val DarkGray = Color(0xFF141414) 6 | val Purple200 = Color(0xFFBB86FC) 7 | val Purple500 = Color(0xFF6200EE) 8 | val Purple700 = Color(0xFF3700B3) 9 | val LightGray = Color(0xFFFCFCFC) 10 | val MediumGray = Color(0xFF9C9C9C) -------------------------------------------------------------------------------- /Source/Former versions/Java/FileFilterer.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | public class FileFilterer implements FileFilter 4 | { 5 | public final String[] AcceptedFileExtensions = new String[] {"doc", "pdf"}; 6 | public boolean accept(File file) 7 | { 8 | for(String extension : AcceptedFileExtensions) 9 | { 10 | if(file.getName().toLowerCase().endsWith(extension)) 11 | return true; 12 | } 13 | return false; 14 | } 15 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Source/Main/Kotlin/UI/WindowMenus.kt: -------------------------------------------------------------------------------- 1 | package ui 2 | import androidx.compose.runtime.Composable 3 | import androidx.compose.ui.window.MenuBarScope 4 | 5 | @Composable 6 | fun MenuBarScope.fileMenu(selectedTheme: Boolean, changeTheme: (Boolean) -> Unit) 7 | { 8 | Menu("Settings", mnemonic = 'S') 9 | { 10 | Menu("Theme") 11 | { 12 | RadioButtonItem("Light", mnemonic = 'L', onClick = { changeTheme(false) }, selected = !selectedTheme) 13 | RadioButtonItem("Dark", mnemonic = 'D', onClick = { changeTheme(true) }, selected = selectedTheme) 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Source/Main/Kotlin/UI/FileDialog.kt: -------------------------------------------------------------------------------- 1 | package ui 2 | import java.io.File 3 | import javax.swing.JFileChooser 4 | import javax.swing.filechooser.FileSystemView 5 | 6 | fun fileChooser(): File? 7 | { 8 | val jfc = JFileChooser(FileSystemView.getFileSystemView().defaultDirectory) 9 | jfc.dialogTitle = "Choose a directory" 10 | jfc.fileSelectionMode = JFileChooser.DIRECTORIES_ONLY 11 | jfc.approveButtonText = "Select directory" 12 | val returnValue = jfc.showOpenDialog(null) 13 | if(returnValue == JFileChooser.APPROVE_OPTION) 14 | { 15 | if(jfc.selectedFile.isDirectory) 16 | return jfc.selectedFile 17 | else 18 | return null 19 | } 20 | return null 21 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | -------------------------------------------------------------------------------- /Source/Main/Kotlin/Theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package theme 2 | import androidx.compose.material.Colors 3 | import androidx.compose.ui.graphics.Color 4 | import androidx.compose.runtime.Composable 5 | import androidx.compose.material.darkColors 6 | import androidx.compose.material.lightColors 7 | import androidx.compose.material.MaterialTheme 8 | import androidx.compose.foundation.isSystemInDarkTheme 9 | 10 | private val DarkColorPalette = darkColors(primary = Purple200, primaryVariant = Purple700, secondary = Teal200, background = Color.White, 11 | surface = Color.Black, onPrimary = Color.White, onSecondary = Color.White, onBackground = Color.White, onSurface = Color.LightGray) 12 | 13 | private val LightColorPalette = lightColors(primary = Purple500, primaryVariant = Purple700, secondary = Teal200, background = Color.White, 14 | surface = Color.White, onPrimary = Color.White, onSecondary = Color.White, onBackground = Color.Black, onSurface = Color.Black) 15 | 16 | @Composable 17 | fun CustomMaterialTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) 18 | { 19 | val colors: Colors = when 20 | { 21 | darkTheme -> DarkColorPalette 22 | else -> LightColorPalette 23 | } 24 | MaterialTheme(colors = colors, content = content) 25 | } -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | -------------------------------------------------------------------------------- /Source/Main/Kotlin/Repos/Repository.kt: -------------------------------------------------------------------------------- 1 | package repos 2 | import java.io.File 3 | import kotlinx.coroutines.flow.update 4 | import kotlinx.coroutines.flow.StateFlow 5 | import javax.swing.filechooser.FileSystemView 6 | import kotlinx.coroutines.flow.MutableStateFlow 7 | 8 | class Repository 9 | { 10 | private val _keywords = MutableStateFlow("") 11 | val keywords: StateFlow = _keywords 12 | 13 | private val _directory = MutableStateFlow("") 14 | val directory: StateFlow = _directory 15 | 16 | private val _outputDirectory = MutableStateFlow("") 17 | val outputDirectory: StateFlow = _outputDirectory 18 | 19 | private val _textArea: MutableStateFlow = MutableStateFlow("") 20 | val textArea: MutableStateFlow = _textArea 21 | 22 | private val _isDarkTheme = MutableStateFlow(false) 23 | val isDarkTheme: StateFlow = _isDarkTheme 24 | 25 | fun updateKeywords(keywords: String) 26 | { 27 | _keywords.value = keywords 28 | } 29 | 30 | fun updateDirectory(file: File?) 31 | { 32 | _directory.value = file?.absolutePath ?: "" 33 | } 34 | 35 | fun updateOutputDirectory(file: File?) 36 | { 37 | val strValue: String? = file?.absolutePath 38 | if(!strValue.isNullOrBlank()) 39 | _outputDirectory.value = "${file.absolutePath}/output.doc" 40 | else 41 | _outputDirectory.value = "" 42 | } 43 | 44 | fun updateTextArea(text: String) 45 | { 46 | _textArea.value = "${_textArea.value}$text\n" 47 | } 48 | 49 | fun changeTheme(bool: Boolean) 50 | { 51 | _isDarkTheme.value = bool 52 | } 53 | } -------------------------------------------------------------------------------- /Source/Main/Kotlin/Main.kt: -------------------------------------------------------------------------------- 1 | import ui.fileMenu 2 | import ui.MainScreen 3 | import repos.Repository 4 | import utils.ResumeScanner 5 | import theme.CustomMaterialTheme 6 | import androidx.compose.runtime.* 7 | import androidx.compose.ui.unit.dp 8 | import androidx.compose.ui.window.* 9 | import androidx.compose.ui.Alignment 10 | 11 | fun main() = application { 12 | val repo = Repository() 13 | val windowState = rememberWindowState(position = WindowPosition(Alignment.Center), width = 650.dp, height = 1000.dp) 14 | Window(onCloseRequest = ::exitApplication, title = "Keyword-based Resume Ranker (V3)", resizable = true, state = windowState) 15 | { 16 | val textArea by repo.textArea.collectAsState() 17 | val keywords by repo.keywords.collectAsState() 18 | val directory by repo.directory.collectAsState() 19 | val isDarkTheme by repo.isDarkTheme.collectAsState() 20 | val outputDirectory by repo.outputDirectory.collectAsState() 21 | 22 | MenuBar( 23 | { 24 | fileMenu(selectedTheme = isDarkTheme, changeTheme = { repo.changeTheme(it) }) 25 | }) 26 | 27 | CustomMaterialTheme(darkTheme = isDarkTheme) 28 | { 29 | MainScreen(keywords = keywords, updateKeywords = repo::updateKeywords, directory = directory, updateDirectory = repo::updateDirectory, 30 | outputDirectory = outputDirectory, updateOutputDirectory = repo::updateOutputDirectory, onButtonClick = 31 | { 32 | ResumeScanner(keyword = keywords, directory = directory, outputDirectory = outputDirectory, updateUI = repo::updateTextArea) 33 | }, textAreaText = textArea) 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |
5 | 6 |

7 | Functionality 8 |

9 | 10 | A multiplatform Kotlin application which scans the files from a specified directory (which as per intention, should contain CVs/resumes) for any number of specific keywords, reads the ones with `.doc`/`.pdf` extensions and subsequently enlists the keywords each file contains and the strength of it (given by the keyword count), in addition to telling apart the resume with the highest score. I built this early on with the mindset to help recruiters to rank resumes from a large candidate pool. Not the most ideal approach, but this is generally one of the steps in filtering out resumes by automated systems. 11 | 12 |
13 |

14 | I/O 15 |

16 | 17 | The program takes three inputs via a Compose-based graphical user interface: 18 | - A string of whitespace separated keywords. 19 | - The directory in which the resumes are stored locally for the user. 20 | - The location where a separate file containing the results for the session will be saved. 21 | 22 | When provided with these, it displays the total weightage of each resume and the best one among the lot with respect to the keyword-based search - all in a text box within the flexible GUI, and additionally within the user-specified file that contains the entire trace of the run for future reference (sort of enacting as a log). 23 | 24 | Here's a short video demonstrating a run with a bunch of authentic resumes: 25 |

26 | 27 |

28 | 29 |
30 |

31 | Notes 32 |

33 | 34 | Resumes other than the ones in the typical formats (i.e., docs and pdfs, including LaTeX ones) although not facilitated here, can be supported - one has to first mention the other extension(s) in the file filter code segment (the easy part) and then proceed to write the corresponding 'specific-to-that-format'-handling text extractor block(s), using some well-defined library (unless you want to do that yourself). For instance, I used Apache POI and PDFBox libraries to handle .doc and .pdf file formats respectively. 35 | 36 |
37 |

38 | License 39 |

40 | 41 |

42 | Going with Apache for this one. 43 |

44 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /Source/Main/Kotlin/UI/MainScreen.kt: -------------------------------------------------------------------------------- 1 | package ui 2 | import java.io.File 3 | import androidx.compose.material.* 4 | import androidx.compose.ui.unit.dp 5 | import androidx.compose.ui.Modifier 6 | import androidx.compose.ui.Alignment 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.foundation.layout.* 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.runtime.LaunchedEffect 11 | import androidx.compose.ui.res.painterResource 12 | import androidx.compose.material.icons.filled.* 13 | import androidx.compose.foundation.verticalScroll 14 | import androidx.compose.foundation.rememberScrollState 15 | 16 | @Composable 17 | fun MainScreen(keywords: String, updateKeywords: (String) -> Unit, directory: String, updateDirectory: (File?) -> Unit, 18 | outputDirectory: String, updateOutputDirectory: (File?) -> Unit, onButtonClick: () -> Unit, textAreaText: String) 19 | { 20 | Surface(modifier = Modifier.fillMaxSize()) 21 | { 22 | Column(horizontalAlignment = Alignment.CenterHorizontally) 23 | { 24 | KeywordTextField(keywords, updateKeywords) 25 | DirectoryTextField(directory, updateDirectory, "Directory", "Pick source directory") 26 | DirectoryTextField(outputDirectory, updateOutputDirectory, "Output Directory", "Pick output directory") 27 | Button(onClick = onButtonClick, enabled = keywords.isNotEmpty() && outputDirectory.isNotEmpty() && directory.isNotEmpty(), modifier = Modifier.padding(5.dp)) 28 | { 29 | Text("Display Results") 30 | } 31 | TextArea(textAreaText) 32 | } 33 | } 34 | } 35 | 36 | @Composable 37 | fun KeywordTextField(keywords: String, updateKeywords: (String) -> Unit) 38 | { 39 | Surface(Modifier.fillMaxWidth().defaultMinSize(minHeight = 50.dp)) 40 | { 41 | TextField(value = keywords, onValueChange = { updateKeywords(it) }, 42 | placeholder = { Text("Keywords") }, label = { Text(text = "Enter keywords") }, 43 | singleLine = true, leadingIcon = 44 | { 45 | Icon(painter = painterResource("keyword-icon.png"), "ThumbUp") 46 | } 47 | ) 48 | } 49 | } 50 | 51 | @Composable 52 | fun DirectoryTextField(dir: String, update: (File?) -> Unit, placeholderText: String, labelText: String) 53 | { 54 | Surface(Modifier.fillMaxWidth().defaultMinSize(minHeight = 50.dp)) 55 | { 56 | TextField(value = dir, onValueChange = {}, placeholder = { Text(placeholderText) }, 57 | label = { Text(text = labelText) }, singleLine = true, leadingIcon = 58 | { 59 | Icon(painter = painterResource("path-icon.png"), null) 60 | }, 61 | trailingIcon = 62 | { 63 | IconButton(onClick = 64 | { 65 | val dir = fileChooser() 66 | update(dir) 67 | }, 68 | enabled = true) 69 | { 70 | Icon(painter = painterResource("folder-icon.png"), contentDescription = "FilePickerIcon") 71 | } 72 | }) 73 | } 74 | } 75 | 76 | @Composable 77 | fun TextArea(text: String) 78 | { 79 | val scrollState = rememberScrollState(0) 80 | LaunchedEffect(scrollState.maxValue) 81 | { 82 | scrollState.animateScrollTo(scrollState.maxValue) 83 | } 84 | Surface(modifier = Modifier.fillMaxSize().padding(5.dp)) 85 | { 86 | TextField(value = text, onValueChange = {}, modifier = Modifier.fillMaxSize().verticalScroll(scrollState)) 87 | } 88 | } -------------------------------------------------------------------------------- /Source/Former versions/Kotlin/GUI.kt: -------------------------------------------------------------------------------- 1 | import java.awt.Font 2 | import java.awt.Color 3 | import java.awt.TextArea 4 | import javax.swing.JFrame 5 | import javax.swing.JLabel 6 | import javax.swing.JPanel 7 | import javax.swing.JButton 8 | import javax.swing.JTextField 9 | import org.apache.log4j.BasicConfigurator 10 | 11 | class GUI(val onClickCallback: () -> Unit): JFrame("Keyword-based Resume Ranker (V2)") 12 | { 13 | // Avoiding initialization of the output text box early on, waiting for the dependency injection of the inputs (keywords, directory): 14 | private lateinit var resultTA: TextArea 15 | 16 | // Initializing inputs to empty strings for the start: 17 | var keyword = "" 18 | var directory = "" 19 | 20 | // Secondary constructor: 21 | init 22 | { 23 | createUI() 24 | } 25 | 26 | // Since I want the font to be accessible outside, without creation of an instance of this class: 27 | companion object 28 | { 29 | private fun defaultFont(size: Int): Font = Font("Comic Sans", Font.BOLD, size) 30 | } 31 | 32 | // Function to create the UI components: (box dimensions taken from my Java version) 33 | private fun createUI() 34 | { 35 | BasicConfigurator.configure() // Log4j shit 36 | defaultCloseOperation = EXIT_ON_CLOSE 37 | 38 | // Setting the window size: (width x height) 39 | setSize(600, 800) 40 | 41 | val jPanel = JPanel().also( 42 | { 43 | it.background = Color.getHSBColor(0.4F, 0.1F, 0.2F) 44 | it.layout = null 45 | }) 46 | 47 | // Text field for the keyword-string input: 48 | val keywordTF = JTextField().also( 49 | { 50 | it.setBounds(95, 60, 470, 20) 51 | it.background = Color.getHSBColor(0.4F, 0.1F, 0.7F) 52 | jPanel.add(it) 53 | }) 54 | 55 | JLabel("Keywords: ").also( 56 | { 57 | it.setBounds(10, 60, 400, 20) 58 | it.font = defaultFont(16) 59 | it.setForeground(Color.getHSBColor(76F, 99F, 99F)) 60 | jPanel.add(it) 61 | }) 62 | 63 | // Text field for the directory input: 64 | val directoryTF = JTextField().also( 65 | { 66 | it.setBounds(95, 90, 470, 20) 67 | it.background = Color.getHSBColor(0.4F, 0.1F, 0.7F) 68 | jPanel.add(it) 69 | }) 70 | 71 | JLabel("Directory: ").also( 72 | { 73 | it.setBounds(14, 90, 400, 20) 74 | it.font = defaultFont(16) 75 | it.setForeground(Color.getHSBColor(76F, 99F, 99F)) 76 | jPanel.add(it) 77 | }) 78 | 79 | // Text box for displaying the output: 80 | resultTA = TextArea().also( 81 | { 82 | it.setBounds(10, 160, 550, 600) 83 | it.background = Color.getHSBColor(0.4F, 0.1F, 0.75F) 84 | jPanel.add(it) 85 | }) 86 | 87 | // Button to launch a homing missile: 88 | JButton("Display Results").also( 89 | { 90 | it.setBounds(190, 120, 190, 30) 91 | it.font = defaultFont(15) 92 | it.foreground = Color.getHSBColor(0.42F, 0.39F, 0.25F) 93 | 94 | it.addActionListener( 95 | { 96 | keyword = keywordTF.text 97 | directory = directoryTF.text 98 | onClickCallback() 99 | }) 100 | 101 | jPanel.add(it) 102 | }) 103 | 104 | contentPane.add(jPanel) 105 | } 106 | 107 | // Function to append strings to the UI: (calling this as in when required to update stuff to the UI only, and not to the log file) 108 | fun updateUI(input: String) 109 | { 110 | resultTA.append("$input\n") 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /Source/Main/Kotlin/Util/ResumeScanner.kt: -------------------------------------------------------------------------------- 1 | package utils 2 | import java.util.* 3 | import java.io.File 4 | import java.io.FileFilter 5 | import java.io.FileWriter 6 | import java.io.FileInputStream 7 | import java.util.regex.Pattern 8 | import org.apache.poi.hwpf.HWPFDocument 9 | import org.apache.pdfbox.pdmodel.PDDocument 10 | import org.apache.pdfbox.text.PDFTextStripper 11 | import org.apache.poi.hwpf.extractor.WordExtractor 12 | 13 | class ResumeScanner(keyword: String, directory: String, outputDirectory: String, val updateUI: (String) -> Unit) 14 | { 15 | // Curating the lists of keywords (extracted from the input string) and desired files: 16 | private var keywordList = keyword.split(" ") 17 | private val filesList = File(directory).listFiles(CustomFileFilter()) 18 | 19 | // Storing the keyword and file counts for future use: 20 | private var totalKeywords = keywordList.count() 21 | private var fileCount = filesList?.count() 22 | 23 | // Variables for the output file (will write to this) and scores corresponding to each resume: (filename, score) 24 | private val fileOutput = FileWriter(LOG_DIRECTORY) 25 | private var scoreList = listOf>() 26 | 27 | init 28 | { 29 | if(fileCount == 0 || filesList.isNullOrEmpty()) 30 | { 31 | println("No .doc/.pdf files found in the specified directory!") 32 | } 33 | else 34 | { 35 | writeToFileAndUI("Total number of keywords: $totalKeywords") 36 | scoreList = keywordFinder(filesList) 37 | val mostKeywordsFound = scoreList.maxOf { it.second } 38 | val bestResume = scoreList.find( 39 | { 40 | it.second == mostKeywordsFound 41 | }) 42 | writeToFileAndUI("Post filtering, the highest ranked resume among the lot is: ${bestResume?.first}") 43 | fileOutput.close() 44 | } 45 | } 46 | 47 | // Function to find keywords in a file: 48 | private fun keywordFinder(inputFileList: Array?): MutableList> 49 | { 50 | val fileScoreList: MutableList> = mutableListOf() 51 | inputFileList?.forEach( 52 | { file -> 53 | when 54 | { 55 | // .doc(<-x) resumes 56 | file.name.endsWith(".doc") -> 57 | { 58 | writeToFileAndUI("Opening the resume '${file.name}' (word format)") 59 | val fileInputStream = FileInputStream(file.absolutePath) 60 | val extractor = WordExtractor(HWPFDocument(fileInputStream)) 61 | val dataList = extractor.paragraphText.toList() 62 | val score = calculateScore(dataList) 63 | fileScoreList.add(Pair(file.name, score)) 64 | writeToFileAndUI("Total number of keywords found in the resume '${file.name}': $score\n") 65 | } 66 | // .pdf resumes 67 | file.name.endsWith(".pdf") -> 68 | { 69 | val pdfDoc: PDDocument = PDDocument.load(file) 70 | writeToFileAndUI("Opening the resume '${file.name}' (pdf format)") 71 | val rawData: String = PDFTextStripper().getText(pdfDoc) 72 | val dataList = Pattern.compile("\\s+").split(rawData.trim()).toList() 73 | val score = calculateScore(dataList) 74 | fileScoreList.add(Pair(file.name, score)) 75 | pdfDoc.close() 76 | writeToFileAndUI("Total number of keywords found in the resume '${file.name}': $score\n") 77 | } 78 | } 79 | }) 80 | return fileScoreList 81 | } 82 | 83 | // Function to compute the scores for each resume: 84 | private fun calculateScore(inputList: List): Int 85 | { 86 | val foundKeywords = mutableListOf() 87 | keywordList.forEach( 88 | { 89 | keyword -> 90 | val found = inputList.find { it == keyword } 91 | if(found != null) 92 | { 93 | writeToFileAndUI("Keyword '$found' was found!") 94 | foundKeywords.add(found) 95 | } 96 | }) 97 | if(foundKeywords.isEmpty()) 98 | { 99 | writeToFileAndUI("No keywords were found in this resume!") 100 | } 101 | return foundKeywords.count() 102 | } 103 | 104 | // Function to write to both an output file and the GUI: (takes the string to be written as input) 105 | private fun writeToFileAndUI(str : String) 106 | { 107 | fileOutput.write(str) 108 | updateUI(str) 109 | } 110 | 111 | // Function to filter out files in a given directory that have 'doc' and 'pdf' extensions: 112 | inner class CustomFileFilter: FileFilter 113 | { 114 | override fun accept(pathname: File?): Boolean 115 | { 116 | listOf("doc", "pdf").forEach( 117 | { 118 | if(pathname != null) 119 | { 120 | if(pathname.name.lowercase(Locale.getDefault()).endsWith(it)) 121 | return true 122 | } 123 | }) 124 | return false 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /Source/Former versions/Kotlin/ResumeScanner.kt: -------------------------------------------------------------------------------- 1 | import java.util.* 2 | import java.io.File 3 | import java.io.FileFilter 4 | import java.io.FileWriter 5 | import java.io.FileInputStream 6 | import java.util.regex.Pattern 7 | import org.apache.pdfbox.Loader 8 | import org.apache.poi.hwpf.HWPFDocument 9 | import org.apache.pdfbox.pdmodel.PDDocument 10 | import org.apache.pdfbox.text.PDFTextStripper 11 | import org.apache.poi.hwpf.extractor.WordExtractor 12 | 13 | class ResumeScanner(private val gui: GUI) 14 | { 15 | // Taking my inputs from the GUI: 16 | private val keyword = gui.keyword 17 | private val directory = gui.directory 18 | 19 | // Curating the lists of keywords (extracted from the input string) and desired files: 20 | private var keywordList = keyword.split(" ") 21 | private val filesList = File(directory).listFiles(CustomFileFilter()) 22 | 23 | // Storing the keyword and file counts for future use: 24 | private var totalKeywords = keywordList.count() 25 | private var fileCount = filesList?.count() 26 | 27 | // Variables for the output file (will write to this) and scores corresponding to each resume: (filename, score) 28 | private val fileOutput = FileWriter(LOG_DIRECTORY) 29 | private var scoreList = listOf>() 30 | 31 | init 32 | { 33 | writeToFileAndUI("Total number of keywords: $totalKeywords") 34 | 35 | if(fileCount == 0 || filesList.isNullOrEmpty()) 36 | { 37 | println("No .doc/.pdf files found in the specified directory!") 38 | } 39 | else 40 | { 41 | scoreList = keywordFinder(filesList) 42 | val mostKeywordFound = scoreList.maxOf { it.second } 43 | val bestResume = scoreList.find( 44 | { 45 | it.second == mostKeywordFound 46 | }) 47 | fileOutput.write("Post filtering, the highest ranked resume among the lot is: ${bestResume?.first}") 48 | gui.updateUI("Post filtering, the highest ranked resume among the lot is: ${bestResume?.first}") 49 | 50 | fileOutput.close() 51 | } 52 | } 53 | 54 | // Function to find keywords in a file: 55 | private fun keywordFinder(inputFileList: Array?): MutableList> 56 | { 57 | val fileScoreList: MutableList> = mutableListOf() 58 | inputFileList?.forEach( 59 | { file -> 60 | when 61 | { 62 | // .doc(<-x) resumes 63 | file.name.endsWith(".doc") -> 64 | { 65 | fileOutput.write("Opening the resume '${file.name}' (word format)") 66 | gui.updateUI("Opening the resume '${file.name}' (word format)") 67 | val fileInputStream = FileInputStream(file.absolutePath) 68 | val extractor = WordExtractor(HWPFDocument(fileInputStream)) 69 | val dataList = extractor.paragraphText.toList() 70 | val score = calculateScore(dataList) 71 | fileScoreList.add(Pair(file.name, score)) 72 | writeToFileAndUI("Total number of keywords found in the resume '${file.name}': $score\n") 73 | } 74 | 75 | // .pdf resumes 76 | file.name.endsWith(".pdf") -> 77 | { 78 | val pdfDoc: PDDocument = Loader.loadPDF(file) 79 | fileOutput.write("Opening the resume '${file.name}' (pdf format)") 80 | gui.updateUI("Opening the resume '${file.name}' (pdf format)") 81 | val rawData: String = PDFTextStripper().getText(pdfDoc) 82 | val dataList = Pattern.compile("\\s+").split(rawData.trim()).toList() 83 | val score = calculateScore(dataList) 84 | fileScoreList.add(Pair(file.name, score)) 85 | pdfDoc.close() 86 | writeToFileAndUI("Total number of keywords found in the resume '${file.name}': $score\n") 87 | } 88 | } 89 | }) 90 | return fileScoreList 91 | } 92 | 93 | // Function to compute the scores for each resume: 94 | private fun calculateScore(inputList: List): Int 95 | { 96 | val score = inputList.count( 97 | { 98 | word -> 99 | if (keywordList.contains(word)) 100 | writeToFileAndUI("Keyword '$word' was found!") 101 | keywordList.contains(word) 102 | }) 103 | 104 | if(score == 0) 105 | writeToFileAndUI("No keywords were found in this resume!") 106 | 107 | return score 108 | } 109 | 110 | // Function to write to both an output file (takes the string to be written as input) and the GUI: 111 | private fun writeToFileAndUI(str: String) 112 | { 113 | fileOutput.write(str) 114 | gui.updateUI(str) 115 | } 116 | 117 | // Function to filter out files in a given directory that have 'doc' and 'pdf' extensions: 118 | inner class CustomFileFilter: FileFilter 119 | { 120 | override fun accept(pathname: File?): Boolean 121 | { 122 | listOf("doc", "pdf").forEach( 123 | { 124 | if(pathname != null) 125 | { 126 | if(pathname.name.lowercase(Locale.getDefault()).endsWith(it)) 127 | return true 128 | } 129 | }) 130 | return false 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /Source/Former versions/Java/ResumeScanner.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | import java.awt.*; 3 | import java.util.*; 4 | import javax.swing.*; 5 | import java.awt.event.*; 6 | import org.apache.pdfbox.*; 7 | import org.apache.poi.hwpf.*; 8 | import org.apache.log4j.BasicConfigurator; 9 | 10 | public class ResumeScanner 11 | { 12 | public static TextArea OutputTextArea; 13 | public static JLabel LabelOne, LabelTwo, LabelThree; 14 | public static JTextField InputTextFieldOne, InputTextFieldTwo; 15 | 16 | public static void main(String[] args) throws IOException 17 | { 18 | BasicConfigurator.configure(); 19 | 20 | // Constructing a new window (600 x 800) with a dull background: 21 | JFrame jf = new JFrame("Keyword-based Resume Ranker (V1)"); 22 | jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setSize(600, 800); 23 | JPanel jpanel = new JPanel(); 24 | jpanel.setBackground(Color.getHSBColor(25, 130, 95)); jpanel.setLayout(null); 25 | 26 | // Adding labels for the GUI: 27 | LabelOne = new JLabel("Resume Scanner"); 28 | LabelOne.setFont(new Font("Comic Sans", Font.BOLD, 20)); 29 | LabelOne.setForeground(Color.white); 30 | 31 | LabelTwo = new JLabel("Keywords: "); 32 | LabelTwo.setFont(new Font("Comic Sans", Font.BOLD, 18)); 33 | LabelTwo.setBounds(10, 60, 400, 20); 34 | 35 | LabelThree = new JLabel("Directory: "); 36 | LabelThree.setFont(new Font("Comic Sans", Font.BOLD, 18)); 37 | LabelThree.setBounds(14, 90, 400, 20); 38 | 39 | // Adding and setting coordinates for test fields (input) and one text area (output): 40 | InputTextFieldOne = new JTextField(); 41 | InputTextFieldOne.setBounds(95, 60, 470, 20); 42 | 43 | InputTextFieldTwo = new JTextField(); 44 | InputTextFieldTwo.setBounds(95, 90, 470, 20); 45 | 46 | OutputTextArea = new TextArea(); 47 | OutputTextArea.setBounds(10, 160, 550, 600); 48 | 49 | // Adding a button to display results on click: 50 | JButton ButtonToDisplay = new JButton("Display Results!"); 51 | ButtonToDisplay.setBounds(190, 120, 190, 30); 52 | ButtonToDisplay.setFont(new Font("Comic Sans", Font.BOLD, 15)); 53 | 54 | // Adding all the components onto the Jframe window: 55 | jpanel.add(LabelOne); 56 | jpanel.add(LabelTwo); 57 | jpanel.add(LabelThree); 58 | 59 | jpanel.add(InputTextFieldOne); 60 | jpanel.add(InputTextFieldTwo); 61 | jpanel.add(OutputTextArea); 62 | 63 | jpanel.add(ButtonToDisplay); 64 | jf.getContentPane().add(jpanel); 65 | jf.setVisible(true); 66 | 67 | ButtonToDisplay.addActionListener(new ActionListener() 68 | { 69 | @Override 70 | public void actionPerformed(ActionEvent e) 71 | { 72 | try 73 | { // Taking whitespace-separated keywords as input (from the first text field; second one's for the directory) and thereafter dividing the input string (splits based on blank space) into an array of keywords: 74 | String keywordString = InputTextFieldOne.getText(), directory = InputTextFieldTwo.getText(); 75 | String[] keywords = keywordString.split(" "); 76 | File dir = new File(directory); 77 | File[] fileslist = dir.listFiles(new FileFilterer()); 78 | int keywordCount = 0, fileCount = 0, highestScore = 0; 79 | 80 | System.out.print("Please enter the filepath of the directory (inside this console) where you would want to store the logs."); 81 | Scanner sin = new Scanner(System.in); 82 | String logDirectory = sin.nextLine(); 83 | sin.close(); 84 | FileWriter foutput = new FileWriter(logDirectory); 85 | 86 | foutput.write("Total number of keywords: " + keywordCount); 87 | OutputTextArea.append("Total number of keywords: " + keywordCount); 88 | 89 | for(File f : fileslist) 90 | { // .doc(<-x) resumes 91 | if(f.getName().endsWith(".doc")) 92 | { 93 | fileCount++; 94 | WordExtractor extractor = null; 95 | try 96 | { 97 | int count = 0; 98 | foutput.write("\nOpening the resume '" + f.getName() + "' (word format)\n"); 99 | OutputTextArea.append("\nOpening the resume '" + f.getName() + "' (word format)\n"); 100 | 101 | FileInputStream fis = new FileInputStream(f.getAbsolutePath()); 102 | HWPFDocument document = new HWPFDocument(fis); 103 | extractor = new WordExtractor(document); 104 | String[] fileData = extractor.getParagraphText(); // Extract all text within the doc file. 105 | String lines[] = fileData; 106 | 107 | for(String line : lines) 108 | { 109 | String check[] = {}; // String array to store all the words from the file. 110 | check = line.split(" "); 111 | for(String word : check) 112 | { 113 | for(String k : keywords) 114 | { 115 | if(word.equals(k)) // Keyword in search is a match against the current iteration's string/word. 116 | { 117 | foutput.write("Keyword '" + k + "' was found!\n"); 118 | OutputTextArea.append("Keyword '" + k + "' was found!\n"); 119 | count++; 120 | } 121 | } // End of keyword comparisons for a word 122 | } // End of the word checking process for a line 123 | } // End of all the line checks (i.e., the entire process) 124 | 125 | foutput.write("Total number of keywords found in '" + f.getName() + "': " + count + "\n"); 126 | OutputTextArea.append("Total number of keywords found in '" + f.getName() + "': " + count + "\n"); 127 | highestScore = (count > highestScore) ? count : highestScore; 128 | 129 | if(count == 0) 130 | { 131 | foutput.write("No keywords were found in this resume!\n"); 132 | OutputTextArea.append("No keywords were found in this resume!\n"); 133 | } 134 | } // End of internal try block (95) 135 | catch(Exception e) { e.printStackTrace(); } 136 | } 137 | 138 | // .pdf resumes 139 | else if(f.getName().endsWith(".pdf")) 140 | { 141 | fileCount++; 142 | try(PDDocument document = PDDocument.load(f)) 143 | { 144 | foutput.write("\nOpening the resume '" + f.getName() + "' (pdf format)\n"); 145 | OutputTextArea.append("\nOpening the resume '" + f.getName() + "' (pdf format)\n"); 146 | 147 | int count = 0; 148 | document.getClass(); 149 | 150 | if(!document.isEncrypted()) 151 | { 152 | PDFTextStripperByArea stripper = new PDFTextStripperByArea(); 153 | stripper.setSortByPosition(true); 154 | PDFTextStripper tStripper = new PDFTextStripper(); 155 | String pdfFileInText = tStripper.getText(document); 156 | String lines[] = pdfFileInText.split("\\r?\\n"); // Splitting lines in the pdf. 157 | 158 | for(String line : lines) 159 | { 160 | String check[] = {}; check = line.split(" "); 161 | for(String word : check) 162 | { 163 | for(String k : keywords) 164 | { 165 | if(word.equals(k)) 166 | { 167 | foutput.write("Keyword '" + k + "' was found!\n"); 168 | OutputTextArea.append("Keyword '" + k + "' was found!\n"); 169 | count++; 170 | } 171 | } 172 | } 173 | } 174 | } 175 | 176 | foutput.write("Total number of keywords found in '" + f.getName() + "': " + count + "\n"); 177 | OutputTextArea.append("Total number of keywords found in '" + f.getName() + "': " + count + "\n"); 178 | highestScore = (count > highestScore) ? count : highestScore; 179 | 180 | if(count == 0) 181 | { 182 | foutput.write("No keywords were found in this resume!\n"); 183 | OutputTextArea.append("No keywords were found in this resume!\n"); 184 | } 185 | } 186 | } 187 | else System.out.print("No .doc/.pdf files were found in the specified directory!"); 188 | } // End of all iterations of the for-loop (done with all the concerned files) 189 | 190 | foutput.write("\nTotal number of files scanned: " + fileCount); 191 | OutputTextArea.append("\nTotal number of files scanned: " + fileCount); 192 | foutput.write("\nHighest number of keywords found in a resume: " + highestScore); 193 | OutputTextArea.append("\nHighest number of keywords found in a resume: " + highestScore); 194 | foutput.close(); 195 | } 196 | catch(Exception ex) { ex.printStackTrace(); } 197 | } 198 | }); // End of Action Listener (67) 199 | } 200 | } -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | # Determine the Java command to use to start the JVM. 120 | if [ -n "$JAVA_HOME" ] ; then 121 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 122 | # IBM's JDK on AIX uses strange locations for the executables 123 | JAVACMD=$JAVA_HOME/jre/sh/java 124 | else 125 | JAVACMD=$JAVA_HOME/bin/java 126 | fi 127 | if [ ! -x "$JAVACMD" ] ; then 128 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 129 | 130 | Please set the JAVA_HOME variable in your environment to match the 131 | location of your Java installation." 132 | fi 133 | else 134 | JAVACMD=java 135 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 136 | 137 | Please set the JAVA_HOME variable in your environment to match the 138 | location of your Java installation." 139 | fi 140 | 141 | # Increase the maximum file descriptors if we can. 142 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 143 | case $MAX_FD in #( 144 | max*) 145 | MAX_FD=$( ulimit -H -n ) || 146 | warn "Could not query maximum file descriptor limit" 147 | esac 148 | case $MAX_FD in #( 149 | '' | soft) :;; #( 150 | *) 151 | ulimit -n "$MAX_FD" || 152 | warn "Could not set maximum file descriptor limit to $MAX_FD" 153 | esac 154 | fi 155 | 156 | # Collect all arguments for the java command, stacking in reverse order: 157 | # * args from the command line 158 | # * the main class name 159 | # * -classpath 160 | # * -D...appname settings 161 | # * --module-path (only if needed) 162 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 163 | 164 | # For Cygwin or MSYS, switch paths to Windows format before running java 165 | if "$cygwin" || "$msys" ; then 166 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 167 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 168 | 169 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 170 | 171 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 172 | for arg do 173 | if 174 | case $arg in #( 175 | -*) false ;; # don't mess with options #( 176 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 177 | [ -e "$t" ] ;; #( 178 | *) false ;; 179 | esac 180 | then 181 | arg=$( cygpath --path --ignore --mixed "$arg" ) 182 | fi 183 | # Roll the args list around exactly as many times as the number of 184 | # args, so each arg winds up back in the position where it started, but 185 | # possibly modified. 186 | # 187 | # NB: a `for` loop captures its iteration list before it begins, so 188 | # changing the positional parameters here affects neither the number of 189 | # iterations, nor the values presented in `arg`. 190 | shift # remove old arg 191 | set -- "$@" "$arg" # push replacement arg 192 | done 193 | fi 194 | 195 | # Collect all arguments for the java command; 196 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 197 | # shell script including quotes and variable substitutions, so put them in 198 | # double quotes to make sure that they get re-expanded; and 199 | # * put everything else in single quotes, so that it's not re-expanded. 200 | 201 | set -- \ 202 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 203 | -classpath "$CLASSPATH" \ 204 | org.gradle.wrapper.GradleWrapperMain \ 205 | "$@" 206 | 207 | # Use "xargs" to parse quoted args. 208 | # 209 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 210 | # 211 | # In Bash we could simply go: 212 | # 213 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 214 | # set -- "${ARGS[@]}" "$@" 215 | # 216 | # but POSIX shell has neither arrays nor command substitution, so instead we 217 | # post-process each arg (as a line of input to sed) to backslash-escape any 218 | # character that might be a shell metacharacter, then use eval to reverse 219 | # that process (while maintaining the separation between arguments), and wrap 220 | # the whole thing up as a single "set" statement. 221 | # 222 | # This will of course break if any of these variables contains a newline or 223 | # an unmatched quote. 224 | # 225 | 226 | eval "set -- $( 227 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 228 | xargs -n1 | 229 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 230 | tr '\n' ' ' 231 | )" '"$@"' 232 | 233 | exec "$JAVACMD" "$@" 234 | -------------------------------------------------------------------------------- /Miscellaneous/License: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [2019 - Present] [Ani, GitHub: @Anirban166] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. --------------------------------------------------------------------------------