Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-sanpack
Browse files Browse the repository at this point in the history
  • Loading branch information
okinawaa authored Jul 30, 2024
2 parents df3f699 + 5fa97f8 commit 01dd3b7
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chilly-cameras-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"es-hangul": patch
---

feat: "이라/라" 케이스 추가
5 changes: 5 additions & 0 deletions .changeset/old-mayflies-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'docs': patch
---

docs: 문서 배포 오류를 해결합니다.
47 changes: 47 additions & 0 deletions docs/src/components/demo/choseong-includes-demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React, { useState } from 'react';
import { choseongIncludes } from 'es-hangul';

export function ChoseongIncludesDemo() {
const [searchWord, setSearchWord] = useState<string>('홍길동');
const [userInput, setUserInput] = useState<string>('ㅎㄱㄷ');

const result = choseongIncludes(searchWord, userInput);

return (
<div className="bg-gray-200 dark:bg-gray-800 rounded-lg shadow-md p-6 max-w-md mx-auto my-8">
<div className="mb-4">
<label htmlFor="searchWord" className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
Search Word
</label>
<input
id="searchWord"
type="text"
placeholder="Enter search word"
value={searchWord}
onChange={e => 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"
/>
</div>
<div className="mb-4">
<label htmlFor="userInput" className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
User Input
</label>
<input
id="userInput"
type="text"
placeholder="Enter user input"
value={userInput}
onChange={e => 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"
/>
</div>
{result !== null && (
<p
className={`mt-4 text-lg ${result ? 'text-green-500 dark:text-green-400' : 'text-red-500 dark:text-red-400'}`}
>
Result: {result ? 'Match found' : 'No match'}
</p>
)}
</div>
);
}
4 changes: 4 additions & 0 deletions src/josa.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('책이에요');
Expand Down
3 changes: 2 additions & 1 deletion src/josa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ type JosaOption =
| '이에요/예요'
| '으로서/로서'
| '으로써/로써'
| '으로부터/로부터';
| '으로부터/로부터'
| '이라/라';

const 로_조사: JosaOption[] = ['으로/로', '으로서/로서', '으로써/로써', '으로부터/로부터'];

Expand Down

0 comments on commit 01dd3b7

Please sign in to comment.