lyrics-transcriber 0.34.0__py3-none-any.whl → 0.34.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. lyrics_transcriber/correction/handlers/syllables_match.py +22 -2
  2. lyrics_transcriber/frontend/.gitignore +23 -0
  3. lyrics_transcriber/frontend/README.md +50 -0
  4. lyrics_transcriber/frontend/dist/assets/index-DqFgiUni.js +245 -0
  5. lyrics_transcriber/frontend/dist/index.html +13 -0
  6. lyrics_transcriber/frontend/dist/vite.svg +1 -0
  7. lyrics_transcriber/frontend/eslint.config.js +28 -0
  8. lyrics_transcriber/frontend/index.html +13 -0
  9. lyrics_transcriber/frontend/package-lock.json +4260 -0
  10. lyrics_transcriber/frontend/package.json +37 -0
  11. lyrics_transcriber/frontend/public/vite.svg +1 -0
  12. lyrics_transcriber/frontend/src/App.tsx +192 -0
  13. lyrics_transcriber/frontend/src/api.ts +59 -0
  14. lyrics_transcriber/frontend/src/components/CorrectionMetrics.tsx +155 -0
  15. lyrics_transcriber/frontend/src/components/DebugPanel.tsx +311 -0
  16. lyrics_transcriber/frontend/src/components/DetailsModal.tsx +297 -0
  17. lyrics_transcriber/frontend/src/components/FileUpload.tsx +77 -0
  18. lyrics_transcriber/frontend/src/components/LyricsAnalyzer.tsx +450 -0
  19. lyrics_transcriber/frontend/src/components/ReferenceView.tsx +287 -0
  20. lyrics_transcriber/frontend/src/components/TranscriptionView.tsx +157 -0
  21. lyrics_transcriber/frontend/src/components/constants.ts +19 -0
  22. lyrics_transcriber/frontend/src/components/styles.ts +13 -0
  23. lyrics_transcriber/frontend/src/main.tsx +6 -0
  24. lyrics_transcriber/frontend/src/types.ts +158 -0
  25. lyrics_transcriber/frontend/src/vite-env.d.ts +1 -0
  26. lyrics_transcriber/frontend/tsconfig.app.json +26 -0
  27. lyrics_transcriber/frontend/tsconfig.json +25 -0
  28. lyrics_transcriber/frontend/tsconfig.node.json +23 -0
  29. lyrics_transcriber/frontend/tsconfig.tsbuildinfo +1 -0
  30. lyrics_transcriber/frontend/vite.config.d.ts +2 -0
  31. lyrics_transcriber/frontend/vite.config.js +6 -0
  32. lyrics_transcriber/frontend/vite.config.ts +7 -0
  33. lyrics_transcriber/review/server.py +18 -29
  34. {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.2.dist-info}/METADATA +1 -1
  35. {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.2.dist-info}/RECORD +38 -7
  36. {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.2.dist-info}/LICENSE +0 -0
  37. {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.2.dist-info}/WHEEL +0 -0
  38. {lyrics_transcriber-0.34.0.dist-info → lyrics_transcriber-0.34.2.dist-info}/entry_points.txt +0 -0
@@ -16,22 +16,42 @@ class SyllablesMatchHandler(GapCorrectionHandler):
16
16
  """Handles gaps where number of syllables in reference text matches number of syllables in transcription."""
17
17
 
18
18
  def __init__(self):
19
+ # Initialize logger first
20
+ self.logger = logging.getLogger(__name__)
21
+
19
22
  # Marking SpacySyllables as used to prevent unused import warning
20
23
  _ = SpacySyllables
24
+
21
25
  # Load spacy model with syllables pipeline
22
- self.nlp = spacy.load("en_core_web_sm")
26
+ try:
27
+ self.nlp = spacy.load("en_core_web_sm")
28
+ except OSError:
29
+ self.logger.info("Language model 'en_core_web_sm' not found. Attempting to download...")
30
+ import subprocess
31
+
32
+ try:
33
+ subprocess.check_call(["python", "-m", "spacy", "download", "en_core_web_sm"])
34
+ self.nlp = spacy.load("en_core_web_sm")
35
+ self.logger.info("Successfully downloaded and loaded en_core_web_sm")
36
+ except subprocess.CalledProcessError as e:
37
+ raise OSError(
38
+ "Language model 'en_core_web_sm' could not be downloaded. "
39
+ "Please install it manually with: python -m spacy download en_core_web_sm"
40
+ ) from e
41
+
23
42
  # Add syllables component to pipeline if not already present
24
43
  if "syllables" not in self.nlp.pipe_names:
25
44
  self.nlp.add_pipe("syllables", after="tagger")
45
+
26
46
  # Initialize Pyphen for English
27
47
  self.dic = pyphen.Pyphen(lang="en_US")
48
+
28
49
  # Initialize NLTK's CMU dictionary
29
50
  try:
30
51
  self.cmudict = cmudict.dict()
31
52
  except LookupError:
32
53
  nltk.download("cmudict")
33
54
  self.cmudict = cmudict.dict()
34
- self.logger = logging.getLogger(__name__)
35
55
 
36
56
  def _count_syllables_spacy(self, words: List[str]) -> int:
37
57
  """Count syllables using spacy_syllables."""
@@ -0,0 +1,23 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist-ssr
12
+ *.local
13
+
14
+ # Editor directories and files
15
+ .vscode/*
16
+ !.vscode/extensions.json
17
+ .idea
18
+ .DS_Store
19
+ *.suo
20
+ *.ntvs*
21
+ *.njsproj
22
+ *.sln
23
+ *.sw?
@@ -0,0 +1,50 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default tseslint.config({
18
+ languageOptions: {
19
+ // other options...
20
+ parserOptions: {
21
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
22
+ tsconfigRootDir: import.meta.dirname,
23
+ },
24
+ },
25
+ })
26
+ ```
27
+
28
+ - Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29
+ - Optionally add `...tseslint.configs.stylisticTypeChecked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
31
+
32
+ ```js
33
+ // eslint.config.js
34
+ import react from 'eslint-plugin-react'
35
+
36
+ export default tseslint.config({
37
+ // Set the react version
38
+ settings: { react: { version: '18.3' } },
39
+ plugins: {
40
+ // Add the react plugin
41
+ react,
42
+ },
43
+ rules: {
44
+ // other rules...
45
+ // Enable its recommended rules
46
+ ...react.configs.recommended.rules,
47
+ ...react.configs['jsx-runtime'].rules,
48
+ },
49
+ })
50
+ ```