diff --git a/.changeset/chilly-cameras-lie.md b/.changeset/chilly-cameras-lie.md new file mode 100644 index 00000000..bd4ce412 --- /dev/null +++ b/.changeset/chilly-cameras-lie.md @@ -0,0 +1,5 @@ +--- +"es-hangul": patch +--- + +feat: "이라/라" 케이스 추가 diff --git a/.changeset/old-mayflies-ring.md b/.changeset/old-mayflies-ring.md new file mode 100644 index 00000000..aaf36791 --- /dev/null +++ b/.changeset/old-mayflies-ring.md @@ -0,0 +1,5 @@ +--- +'docs': patch +--- + +docs: 문서 배포 오류를 해결합니다. diff --git a/docs/src/components/demo/choseong-includes-demo.tsx b/docs/src/components/demo/choseong-includes-demo.tsx new file mode 100644 index 00000000..faaf8c8c --- /dev/null +++ b/docs/src/components/demo/choseong-includes-demo.tsx @@ -0,0 +1,47 @@ +import React, { useState } from 'react'; +import { choseongIncludes } from 'es-hangul'; + +export function ChoseongIncludesDemo() { + const [searchWord, setSearchWord] = useState('홍길동'); + const [userInput, setUserInput] = useState('ㅎㄱㄷ'); + + const result = choseongIncludes(searchWord, userInput); + + return ( +
+
+ + setSearchWord(e.target.value)} + className="w-full p-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-300" + /> +
+
+ + setUserInput(e.target.value)} + className="w-full p-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-300" + /> +
+ {result !== null && ( +

+ Result: {result ? 'Match found' : 'No match'} +

+ )} +
+ ); +} diff --git a/src/josa.spec.ts b/src/josa.spec.ts index 25e33b30..63f23969 100644 --- a/src/josa.spec.ts +++ b/src/josa.spec.ts @@ -41,6 +41,10 @@ describe('Hangul', () => { expect(josa('고기', '이랑/랑')).toBe('고기랑'); expect(josa('과일', '이랑/랑')).toBe('과일이랑'); }); + it('주제의 보조사', () => { + expect(josa('의사', '이라/라')).toBe('의사라'); + expect(josa('선생님', '이라/라')).toBe('선생님이라'); + }); it('서술격조사와 종결어미', () => { expect(josa('사과', '이에요/예요')).toBe('사과예요'); expect(josa('책', '이에요/예요')).toBe('책이에요'); diff --git a/src/josa.ts b/src/josa.ts index 54abdb6e..6fc5c007 100644 --- a/src/josa.ts +++ b/src/josa.ts @@ -14,7 +14,8 @@ type JosaOption = | '이에요/예요' | '으로서/로서' | '으로써/로써' - | '으로부터/로부터'; + | '으로부터/로부터' + | '이라/라'; const 로_조사: JosaOption[] = ['으로/로', '으로서/로서', '으로써/로써', '으로부터/로부터'];