コード例 #1
0
ファイル: EmuLuaLibrary.cs プロジェクト: wert23239/BizHawk
        public ResumeResult ResumeScript(Lua script)
        {
            _currThread = script;

            try
            {
                LuaLibraryBase.SetCurrentThread(_currThread);

                var execResult = script.Resume(0);
                script.Resume(1);
                _lua.RunScheduledDisposes();
                //not sure how this is going to work out, so do this too
                script.RunScheduledDisposes();

                _currThread = null;
                var result = new ResumeResult();
                if (execResult == 0)
                {
                    // terminated
                    result.Terminated = true;
                }
                else
                {
                    // yielded
                    result.WaitForFrame = FrameAdvanceRequested;
                }

                FrameAdvanceRequested = false;
                return(result);
            }
            finally
            {
                LuaLibraryBase.ClearCurrentThread();
            }
        }
コード例 #2
0
ファイル: AbsStorage.cs プロジェクト: xtuyaowu/xparser
 public bool Save(FileActivity activity, ResumeResult data)
 {
     try
     {
         _Save(activity, data);
         return(true);
     }
     catch (Exception ex)
     {
         LoggerWrapper.Logger.Error("简历数据存储异常", ex);
         return(false);
     }
 }
コード例 #3
0
        protected override void _Save(FileActivity activity, ResumeResult data)
        {
            if (activity.IsChanged)
            {
                _conn.ExecuteScalar(string.Format("delete from resumelist where guid='{0}';delete from resumedetaillist where guid='{0}';", activity.HashCode));
            }

            DateTime dateTime = DateTime.Now;

            ResumeData resumeData = data.ResumeInfo;

            //记录简历信息
            _conn.ExecuteNonQuery(string.Format(InsertResumeSql, activity.HashCode, resumeData.Name, resumeData.Age, resumeData.Gender, resumeData.Phone, resumeData.Email, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.LatestDegree, resumeData.JobTarget == null ? string.Empty : resumeData.JobTarget.JobCareer, resumeData.Residence, activity.FilePath, "本地计算机", resumeData.WorkYears, dateTime.ToString(DateFormat), dateTime.ToUniversalTime(), Dorado.SystemInfo.SystemInfo.GetMacAddress(), data.Text));
        }
コード例 #4
0
        public OperateResult <ResumeResult> ParseText(string text)
        {
            try
            {
                //先判别文件是否是有效简历
                OperateResult <ResumePredictResult> predictResult = PredictText(text);

                if (predictResult.Status == OperateStatus.Failure)
                {
                    return(new OperateResult <ResumeResult>(OperateStatus.Failure, predictResult.Description));
                }

                ResumeResult resumeResult = new ResumeResult
                {
                    Text  = predictResult.Data.Text,
                    Score = predictResult.Data.Score
                };

                if (!predictResult.Data.IsResume)
                {
                    return(new OperateResult <ResumeResult>(OperateStatus.Failure, string.Format("不是有效的简历格式,得分[{0}]", predictResult.Data.Score), resumeResult));
                }

                //文本简历解析
                TextCVParser parser     = new TextCVParser(predictResult.Data.Text);
                ResumeData   resumeData = parser.Parse();
                if (!resumeData.IsValid())
                {
                    return(new OperateResult <ResumeResult>(OperateStatus.Failure, "不是有效的简历格式,缺少简历必要信息", resumeResult));
                }

                resumeResult.IsResume   = true;
                resumeResult.ResumeInfo = resumeData;
                return(new OperateResult <ResumeResult>(OperateStatus.Success, "操作成功", resumeResult));
            }
            catch (Exception ex)
            {
                LoggerWrapper.Logger.Error("简历解析错误", ex);
                return(new OperateResult <ResumeResult>(OperateStatus.Failure, ex.Message));
            }
        }
コード例 #5
0
ファイル: EmuLuaLibrary.cs プロジェクト: stuff2600/RAEmus
        public ResumeResult ResumeScript(Lua script)
        {
            EventsLibrary.CurrentThread = script;
            _currThread = script;
            var execResult = script.Resume(0);

            _currThread = null;
            var result = new ResumeResult();

            if (execResult == 0)
            {
                // terminated
                result.Terminated = true;
            }
            else
            {
                // yielded
                result.WaitForFrame = FrameAdvanceRequested;
            }

            FrameAdvanceRequested = false;
            return(result);
        }
コード例 #6
0
        public override ResumeResult ResumeScript(LuaFile lf)
        {
            _currThread = lf.Thread;

            try
            {
                LuaLibraryBase.SetCurrentThread(lf);

                var execResult = _currThread.Resume(0);

                _lua.RunScheduledDisposes();                 // TODO: I don't think this is needed anymore, we run this regularly anyway

                // not sure how this is going to work out, so do this too
                _currThread.RunScheduledDisposes();

                _currThread = null;
                var result = new ResumeResult();
                if (execResult == 0)
                {
                    // terminated
                    result.Terminated = true;
                }
                else
                {
                    // yielded
                    result.WaitForFrame = FrameAdvanceRequested;
                }

                FrameAdvanceRequested = false;
                return(result);
            }
            finally
            {
                LuaLibraryBase.ClearCurrentThread();
            }
        }
コード例 #7
0
        public ResumeResult ResumeScript(Lua script)
        {
            _currThread = script;

            try
            {
                LuaLibraryBase.SetCurrentThread(_currThread);

                var execResult = script.Resume(0);

                _lua.RunScheduledDisposes();
                //not sure how this is going to work out, so do this too
                script.RunScheduledDisposes();

                _currThread = null;
                var result = new ResumeResult();
                if (execResult == 0)
                {
                    // terminated
                    result.Terminated = true;
                }
                else
                {
                    // yielded
                    result.WaitForFrame = FrameAdvanceRequested;
                }

                FrameAdvanceRequested = false;
                return result;
            }
            finally
            {
                LuaLibraryBase.ClearCurrentThread();
            }
        }
コード例 #8
0
 protected override void _Save(FileActivity activity, ResumeResult data)
 {
     throw new NotImplementedException();
 }
コード例 #9
0
ファイル: EmuLuaLibrary.cs プロジェクト: ddugovic/RASuite
		public ResumeResult ResumeScript(Lua script)
		{
			EventsLibrary.CurrentThread = script;
			_currThread = script;
			var execResult = script.Resume(0);
			_currThread = null;
			var result = new ResumeResult();
			if (execResult == 0)
			{
				// terminated
				result.Terminated = true;
			}
			else
			{
				// yielded
				result.WaitForFrame = FrameAdvanceRequested;
			}

			FrameAdvanceRequested = false;
			return result;
		}
コード例 #10
0
ファイル: AbsStorage.cs プロジェクト: xtuyaowu/xparser
 protected abstract void _Save(FileActivity activity, ResumeResult data);