Skip to content

Commit

Permalink
Merge pull request #6 from tramyardg/parse-experience
Browse files Browse the repository at this point in the history
Parse experience
  • Loading branch information
tramyardg authored May 28, 2018
2 parents 2284d38 + 1edf4fb commit b8541e0
Show file tree
Hide file tree
Showing 19 changed files with 388 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
Expand Down
13 changes: 10 additions & 3 deletions .settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.7
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
<artifactId>javafaker</artifactId>
<version>0.15</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>
1 change: 0 additions & 1 deletion public/resume.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Belarus, Minsk. February 2012 - September 2014

Real Estate Agency Assistant heals LLC, Full stack PHP Developer
Belarus, Minsk, http://www.a-h.by; May 2011 - January 2012
google.com
Dynamic website design and programming using PHP, MySQL, HTML, CSS. Setup and administration of web servers and server software.
Business consulting of securing/ planning project.
Development to online marketing, search engine placement and promotion (http://www.mogu.by; http://www.a-h.by).
Expand Down
217 changes: 9 additions & 208 deletions src/main/java/com/cv/parser/CVparserMain.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
package com.cv.parser;

import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
Expand All @@ -26,10 +14,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cv.parser.util.ImagePanel;
import com.cv.parser.util.Message;
import com.cv.parser.util.JDialogHelper;
import com.cv.parser.applicant.CVForm;
import com.cv.parser.applicant.DocumentDetails;
import com.cv.parser.extract.ExtractFiles;
import com.cv.parser.extract.MSExtractor;
Expand All @@ -40,206 +24,23 @@

public class CVparserMain {
static Logger logger = LoggerFactory.getLogger(CVparserMain.class);
private static Message message = new Message();
File resumesStoragePath = new File(CVparserSingleton.getInstance().resumesStoragePath);
protected Shell shell;

private static BufferedImage image;
private static JFrame mainFrame;
protected JDialog parentDialog;

/**
* Launch the application.
*
* @param args
*/
public static void main(String[] args) {

// Schedule a job for the event-dispatching thread: //creating and
// Showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createGUIMenu();
}
});
public static void main(String[] args) {
try {
CVparserMain window = new CVparserMain();
window.open();
} catch (Exception e) {
logger.error("main", e);
}

/*
* Create and setup the Frame Windows GUI
*/
protected static void createGUIMenu() {
mainFrame = new javax.swing.JFrame(message.msg("mainTitle")); // Prepare
// a
// blank
// frame
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

JPanel panel = new ImagePanel(); // prepare the JPanel that hosted the
// background image
mainFrame.add(panel);

CVparserMain app = new CVparserMain(); // start the quiz menu

mainFrame.setJMenuBar(app.createMenu()); // Set up the menu bar on the
// top of the frame

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
mainFrame.setSize(screenSize.width, screenSize.height);

mainFrame.setVisible(true);
}

/**
* Set up the menu bar, on the top of the frame.. Addition: only comments
* March 15 2017 @author RAYMARTHINKPAD This creates the menus in the frame.
* The menu includes items that are event driven on click the action will be
* performed.
*/
public JMenuBar createMenu() {
JMenuBar menuBar = new JMenuBar(); // create the menu bar at the top of

// Add your testing under the first Menu..
JMenu fileMenu = new JMenu("Test Parsing using JSON"); // First group will handle master
fileMenu.setMnemonic(KeyEvent.VK_F); // The shortcut is ALT + M (Master
menuBar.add(fileMenu); // add to the menu bar

// Thje menu item for your test code is here...
JMenuItem parseMenuTest1 = new JMenuItem("Regex JSON style", KeyEvent.VK_D);
parseMenuTest1.setToolTipText("Test parsing Document");
parseMenuTest1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
parseMenuTest1MenuItemActionPerformed(evt);
// entryUserMenuItemActionPerformed(evt);
}
});

fileMenu.add(parseMenuTest1);


// Thje menu item for your test code is here...
JMenuItem parseMenuTest2 = new JMenuItem("You GUI JPanel here", KeyEvent.VK_D);
parseMenuTest2.setToolTipText("Test parsing Document");
parseMenuTest2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
parseMenuTest2MenuItemActionPerformed(evt);
}
});

fileMenu.add(parseMenuTest2);




/************ This menu is for my menu test 40046196 *************/

// Third Menu in Menu Bar is Window About and Exit
JMenu menu2 = new JMenu("Parse Doc 2 Test");
menu2.setMnemonic(KeyEvent.VK_H); // Shortcut is ALT + E
menuBar.add(menu2); // add exit menu to menu bar

// First menu item for windows is About
JMenuItem uploadDocumentToForm = new JMenuItem("Parse Doc to Form", KeyEvent.VK_A);
uploadDocumentToForm.setToolTipText("Parse Doc to Form");
uploadDocumentToForm.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
uploadDocumentToFormActionPerformed(evt);
}
});

menu2.add(uploadDocumentToForm); // add about menu item to exit MEnu


return menuBar;
}

/**
* The events when user click UserForm
* Note from me:
* Should porting the forms in JPanel like previous projects, manageable control form Tree Menu Structure.
* Also using JPanel, would learn how to advance the use of JTable, position, etc.
* For now the menu only call your design procedure directly..
*
* @param evt
*/
private void parseMenuTest1MenuItemActionPerformed(java.awt.event.ActionEvent evt) {

try {
this.open();
} catch (Exception e) {
logger.error("main", e);
}


// UserForm userForm = new UserForm(); // create instance UserForm
// JDialog dialog = new JDialog(this.mainFrame, message.msg("userFormTitle"), true);
//
// dialog.add(userForm);
// dialog.pack();
//
// Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// Dimension dialogSize = dialog.getSize(); // get your frame size
// dialog.setLocation(new Point((screenSize.width - dialogSize.width) / 2,
// (screenSize.height - dialogSize.height) / 2)); // to the center
// // of screen
// dialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
// JDialogHelper.setJDialogTree(dialog, null, null);
// dialog.setVisible(true); // When setVisible this program waiting, until
// // you close the dialog.
// dialog.dispose();

}

private void parseMenuTest2MenuItemActionPerformed(java.awt.event.ActionEvent evt) {

com.cv.parser.About cvForm = new com.cv.parser.About(); // create instance UserForm
JDialog dialog = new JDialog(this.mainFrame, "CV Form", true);

dialog.add(cvForm);
dialog.pack();

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension dialogSize = dialog.getSize(); // get your frame size
dialog.setLocation(new Point((screenSize.width - dialogSize.width) / 2,
(screenSize.height - dialogSize.height) / 2)); // to the center
// of screen
dialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
JDialogHelper.setJDialogTree(dialog, null, null);
dialog.setVisible(true); // When setVisible this program waiting, until
// you close the dialog.
dialog.dispose();

}

private void uploadDocumentToFormActionPerformed(java.awt.event.ActionEvent evt) {

com.cv.parser.applicant.CVForm cvForm = new com.cv.parser.applicant.CVForm(); // create instance UserForm
JDialog dialog = new JDialog(this.mainFrame, "CV Form" , true);

dialog.add(cvForm);
dialog.pack();

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension dialogSize = dialog.getSize(); // get your frame size
dialog.setLocation(new Point((screenSize.width - dialogSize.width) / 2,
(screenSize.height - dialogSize.height) / 2)); // to the center
// of screen
dialog.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
JDialogHelper.setJDialogTree(dialog, null, null);
dialog.setVisible(true); // When setVisible this program waiting, until
// you close the dialog.
dialog.dispose();

}


// public static void main(String[] args) {
// try {
// CVparserMain window = new CVparserMain();
// window.open();
// } catch (Exception e) {
// logger.error("main", e);
// }
// }
}

/**
* Open the window.
Expand Down Expand Up @@ -355,4 +156,4 @@ protected void createContents() {
dd.handleButtonClick();
/**** saving to database END ****/
}
}
}
19 changes: 13 additions & 6 deletions src/main/java/com/cv/parser/RegEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ public enum RegEx {
LINK ("(?:^|[\\W])((ht|f)tp(s?):\\/\\/|www\\.)(([\\w\\-]+\\.){1,}?([\\w\\-.~]+\\/?)*[\\p{Alnum}.,%_=?&#\\-+()\\[\\]\\*$~@!:/{};']*)"),
EMAIL ("[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+"),
PHONE ("\\(?([0-9]{3})\\)?[-. ]([0-9]{3})[-. ]?[-. ]?([0-9]{4})"),
OBJECTIVE ("\\b(Objective|Objectives|OBJECTIVE|OBJECTIVES)([^-!@#$%^&*()+.,?])\\b"),
EDUCATION ("\\b(Education|Educations|EDUCATION|EDUCATIONS)\\b"),
EXPERIENCE ("\\b(Experience|Experiences|EXPERIENCE|EXPERIENCES)\\b");
OBJECTIVE ("\\b(Objective(s?)|OBJECTIVE(S?)|Summary|SUMMARY)([^-!@#$%^&*()+.,?])\\b"), // summary included here
EDUCATION ("\\b(Education(s?)|EDUCATION(S?))\\b"),
EXPERIENCE ("\\b(Experience(s?)|EXPERIENCE(S?))\\b"),
SKILLS ("\\b(Skill(s?) & Expertise(s?)|Tool(s?) & Technolog(y?|ies?)|Skill(s?)|SKILL(S?))\\b"),
LANGUAGE ("\\b(Language(s?)|LANGUAGE(S?))\\b"),
INTEREST ("\\b(Interest(s?)|INTEREST(S?)|Activity|Activities|ACTIVITY|ACTIVITIES)\\b"),
MEMBERSHIP ("\\b(Membership(s?)|MEMBERSHIP(S?))\\b"),
ADDITIONAL ("\\b(Award(s?)|AWARD(S)|Honor(s?)|HONOR(S?)|Certification(s?)|CERTIFICATION(S?)|Accomplishment(s?)|ACCOMPLISHMENT(S?)|Project(s?)|PROJECT(S?))\\b"),
DATEFROMTO ("([A-Za-z]+\\s)?([0-9]{4})\\s[-]\\s\\b((P|p)resent|(C|c)urrent)\\b|([A-Za-z]+\\s)?([0-9]{4})");

// TODO
// there is also SKILLS, LANGUAGES and
// ADDITIONAL that contains (awards, honors, projects, courses, certification)
/**
* Note:
* - if you have a combination of words make sure you put them in the beginning of the list
*/

private final String name;

Expand Down
Loading

0 comments on commit b8541e0

Please sign in to comment.