o
    +wis                     @   s^   d dl mZ d dlZd dlZd dlZzd dlZW n	 ey!   Y nw d dlmZ dddZ	dS )    )absolute_importN)utils   c                    s   t  rtd dS g d}dtjtjf }|tjg  fdd|D }| p*t  } t	j
dkrE| dd	krE| d
rEd| dd	  } | rWt j| ddd||dd dS td)a  Initializes the Java virtual machine (JVM).

    :param jvmpath: The path of the JVM. If left empty, inferred by :py:func:`jpype.getDefaultJVMPath`.
    :param max_heap_size: Maximum memory usage limitation (Megabyte). Default is 1024 (1GB). If you set this value too small, you may got out of memory. We recommend that you set it 1024 ~ 2048 or more at least. However, if this value is too large, you may see inefficient memory usage.

    z*JVM is already running. Do not init twice!N)z{0}z	{0}{1}bin{0}{1}*z{0}{1}jhannanum-0.8.4.jarz{0}{1}kkma-2.0.jarz{0}{1}aho-corasick.jarz{0}{1}shineware-common-1.0.jarz{0}{1}shineware-ds-1.0.jarz{0}{1}komoran-3.0.jarz{0}{1}snakeyaml-1.12.jarz{0}{1}scala-library-2.12.3.jarz {0}{1}open-korean-text-2.1.0.jarz{0}{1}twitter-text-1.14.7.jarr   z%s%sjavac                    s   g | ]}|j   qS  )format).0fargsr   G/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/konlpy/jvm.py
<listcomp>5   s    zinit_jvm.<locals>.<listcomp>darwinz1.8.0r   zlibjvm.dylibz%s/lib/jli/libjli.dylibz/lib/z-Dfile.encoding=UTF8z-eaz-Xmx{}mT)	classpathconvertStringszPlease specify the JVM path.)jpypeisJVMStartedloggingwarningr   installpathossepgetDefaultJVMPathsysplatformfindendswithsplitstartJVMr   
ValueError)jvmpathmax_heap_sizefolder_suffixjavadirr   r   r
   r   init_jvm   s(   




r$   )Nr   )

__future__r   r   r   r   r   ImportErrorkonlpyr   r$   r   r   r   r   <module>   s   