목록Mini Project/간단한 자연어 데이터 처리 (3)
Allen's 데이터 맛집
실전 활용 예시 예시 1: 매출 데이터 분석이번에는 실제 예시를 통해 정규식을 활용하는 방법을 알아보겠습니다. 대형 쇼핑몰의 매출 데이터를 분석하여 특정 패턴의 단어를 추출하는 예제입니다.import java.util.regex.*;import java.util.ArrayList;public class SalesDataAnalysis { public static void main(String[] args) { String text = "January123, February456, March789 sales data."; Pattern pattern = Pattern.compile("\\b\\w*\\d+\\w*\\b"); Matcher matcher = patte..
특정 패턴 추출 정규식을 사용하면 특정 패턴의 단어를 추출할 수 있습니다. 이번에는 숫자가 포함된 단어를 추출하는 방법을 알아보겠습니다.import java.util.regex.*;import java.util.ArrayList;public class PatternWordExtraction { public static void main(String[] args) { String text = "Order123, product456, and item789 are in the list."; Pattern pattern = Pattern.compile("\\b\\w*\\d+\\w*\\b"); Matcher matcher = pattern.matcher(text); ..
프로젝트 개요Java 정규식을 활용하여 단어를 추출하는 프로젝트를 소개합니다. 이 프로젝트는 제가 학부시절 소소하게 해보았었고, Java를 사용해 텍스트에서 특정 단어를 추출해 보았습니다. 기본 사용법정규식(Regex)은 텍스트를 검색하고 조작하는 데 매우 강력한 도구입니다. 프로젝트의 기본 사용법을 통해 간단한 단어 추출 예제를 살펴보겠습니다. import java.util.regex.*;import java.util.ArrayList;public class BasicWordExtraction { public static void main(String[] args) { String text = "Hello, this is a sample text with several words.";..